0
votes

Need help in writing a stored procedure, for copying data from one table to multiple tables. Here is the scenario example:

  1. Table1 has 10 columns with 20 rows of data.

  2. Table2 (primary key will be sequence generator),Table3

  3. Insert 4 columns values from Table1 into Table2, and 4 columns into Table3 (Check condition below) Condition when inserting data into table3:

-Whenever data is inserted into Table3 (from table1) there will be one field in table3 which has the primary key value of Table2 and some values from Table 1.

Please help....

1

1 Answers

0
votes

try INSERT INTO dest_table (COL1,COL2,...,COLn) SELECT COLa,COLb,...,COLz FROM source_table