I am just wondering whether it is possible to insert data from one pl/sql table to another using bulkcollect?
I am trying it out but looks like it is not possible conceptually and the only way is to loop through the Pl/sql table .
Any insights would be really helpful. Thanks
below is the simplified version of what i am trying. i think i am making some conceptual mistake here . hence it is not working:
DECLARE
TYPE ROWTBL IS TABLE OF BW_COLUMN.NAME%TYPE ;
PL_TBL_ROW ROWTBL;
TYPE COLNAME_TBL IS TABLE OF BW_COLUMN.NAME%TYPE ;
PL_TBL_COLNAME COLNAME_TBL;
BEGIN
SELECT NAME
BULK COLLECT INTO PL_TBL_ROW
FROM TBL_COL WHERE TBL_ID = 2000081;
SELECT NAME
BULK COLLECT INTO PL_TBL_COLNAME
FROM PL_TBL_ROW;
END;
BULK COLLECT
is a mechanism for efficiently reading data into PL/SQL data structures so they can be processed by PL/SQL code. You can certainly use this approach for copying data from one table to another but I suspect it will probably take more time than the simpler approach of using an INSERT statement such asBest of luck.