This is a discussion on multitable insert vs. normal inserts in a loop within the Oracle Database forums, part of the Database Server Software category; --> i'd be grateful if someone could tell me what is faster: 1) 5 normal inserts to 5 different tables ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| i'd be grateful if someone could tell me what is faster: 1) 5 normal inserts to 5 different tables in a loop 2) 1 multitable insert in a loop it has to look like: 1) for v_qry in (select * from source_table) loop insert into table_1 (p1,p2,p3,...) values (v1,v2,v3,...); insert into table_2 (p1,p2,p3,...) values (v1,v2,v3,...); insert into table_3 (p1,p2,p3,...) values (v1,v2,v3,...); insert into table_4 (p1,p2,p3,...) values (v1,v2,v3,...); insert into table_5 (p1,p2,p3,...) values (v1,v2,v3,...); /* extra instructions */ end loop; 2) for v_qry in (select * from source_table) loop insert all into table_1 (p1,p2,p3,...) values (v1,v2,v3,...) into table_2 (p1,p2,p3,...) values (v1,v2,v3,...) into table_3 (p1,p2,p3,...) values (v1,v2,v3,...) into table_4 (p1,p2,p3,...) values (v1,v2,v3,...) into table_5 (p1,p2,p3,...) values (v1,v2,v3,...) select * from source_table where id = v_qry.id; /* extra instructions */ end loop; and the solution without the loop is impossible to use 'cause i have some extra instructions in it thanks for any suggestions And. |
| ||||
| "Kaly" <akaliski@gazeta.pl> wrote in message news:a3d58995.0412091127.2a91add@posting.google.co m... > i'd be grateful if someone could tell me what is faster: What is preventing YOU from doing your own testing? SQL> SET TIME ON |
| Thread Tools | |
| Display Modes | |
|
|