Thanks for the question.
Asked: December 08, 2016 - 5:41 am UTC
Last updated: April 19, 2021 - 5:36 am UTC
Version: 12.1.2.0
Viewed 10K+ times! This question is
SQL> declare 2 cursor c is 3 select sq_test_1.NEXTVAL seq, table_name, subpartition_name 4 FROM user_tab_subpartitions; 5 type clist is table of c%rowtype; 6 l_rows clist; 7 8 begin 9 open c; fetch c bulk collect into l_rows; close c; 10 11 for i in 1 .. l_rows.count 12 loop 13 INSERT INTO table_1(a,b,c) 14 values ( l_rows(i).seq, l_rows(i).table_name, l_rows(i).subpartition_name ); 15 end loop; 16 end; 17 / PL/SQL procedure successfully completed.
Abhijit, April 18, 2021 - 8:05 am UTC
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library