我想从嵌套表中获取表。
创建表类型:
CREATE OR REPLACE TYPE Name_list_t AS TABLE OF VARCHAR2(50)
更改我的表添加列嵌套表:
ALTER TABLE MOVIES ADD Movi_name_list Name_list_t NESTED TABLE Movi_name_list STORE AS Movi_name_list
将表添加到嵌套表:
Declare
extractNames Name_list_t;
Begin
(...) some code...
update movies set movi_name_list=extractNames where movi_id=id_movie;
End;
插入表格效果很好。最后,我想从嵌套表中获取表,但我不知道如何。我尝试了两种方法但没有成功:
select movi_name_list into extractNames from movies where movi_id=1;
extractNames := select movi_name_list from movies;
谢谢您的帮助。