0

I want get table from nested table.

Create table type:

CREATE OR REPLACE TYPE Name_list_t AS TABLE OF VARCHAR2(50)

Alter my table adding column nested table:

ALTER TABLE MOVIES ADD Movi_name_list Name_list_t NESTED TABLE Movi_name_list STORE AS Movi_name_list

Add table to nested table:

Declare
extractNames Name_list_t;
Begin
(...) some code...
update movies set movi_name_list=extractNames where movi_id=id_movie;
End;

Inserting table work great. Finally, I want get table from nested table and I don't know how. I try two ways but no successful:

select movi_name_list into extractNames from movies where movi_id=1; 
extractNames := select movi_name_list from movies;

Thank you for your help.

Sebas
  • 21,192
  • 9
  • 55
  • 109
estradowiec
  • 241
  • 1
  • 4
  • 15

1 Answers1

0

Select from @Egor Skriptunoff work!

Solution:

select column_value bulk collect into extractNames from table(select movi_name_list from movies where movi_id=1)

My select cast incorrectly, I guess.

Community
  • 1
  • 1
estradowiec
  • 241
  • 1
  • 4
  • 15