如何将查询中的数据添加到嵌套表中?
我有我的嵌套表:TYPE TABLE_DATA IS TABLE OF NUMBER;
和我的查询SELECT num FROM table_one JOIN table_two t2 ON table_one.num = t2.num WHERE f1.id = pid;
我想num
在我的嵌套表中存储每个行的存储。(我必须使用嵌套表。)
使用BULK COLLECT
:
DECLARE
TYPE table_data IS TABLE OF NUMBER;
l_data table_data;
BEGIN
SELECT num
BULK COLLECT INTO l_data
FROM table_one
JOIN table_two t2 ON table_one.num = t2.num
WHERE f1.id = pid;
END;