Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> copying 1 record - along with all its atribute from other table
Hi!
I have this problem of making duplicate of one record in a main table, along with making duplicate of all the records in atribute tables linked to the original record.
The structure is as such: there is one main table and several atribute tables, where multiple records in atribute tables is associated with one record in main table (using main table's primary key).
The obvious solution is having multiple statements like this:
insert into <tablenameN>
select :newid, <field2>,<field3>... from <tablenameN> where id=:oldid
one for each table.
The :newid defined to the new key value for the new record from main
table.
My questions:
Thank you.
-- S P Arif Sahari Wibowo _____ _____ _____ _____ /____ /____/ /____/ /____ arifsaha_at_yahoo.com _____/ / / / _____/ http://www.arifsaha.com/Received on Thu Feb 13 2003 - 17:23:09 CST
![]() |
![]() |