[Solved] How to traverse the same table with nested cursors in oracle [closed]


Try something like this:

begin

  for c in (select * from child_table) loop
  
    insert into table1
      select * from parent_table where column_1 = c.column_10;
  
    insert into table2
      select * from parent_table where column_1 = c.column_10;
  
    insert into table3
      (column_1,
       column_2,
       column_3,
       column_4,
       column_5,
       column_6,
       column_7,
       column_8,
       column_9,
       column_10)
    values
      (c.column_1,
       c.column_2,
       c.column_3,
       c.column_4,
       c.column_5,
       c.column_6,
       c.column_7,
       c.column_8,
       c.column_9,
       c.column_10);
  end loop;
end;

solved How to traverse the same table with nested cursors in oracle [closed]