Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle SQL - Help on copying record to same table with different value for primary key
Here is my table:
CREATE TABLE tblPerson (
ProjectYear varchar2(4),
ProjectNumber varchar2(4),
ModificationNumber varchar2(3),
Description varchar2(4000),
Primary Key (ProjectYear,ProjectNumber,ModificationNumber));
I want to be able to copy a record with a certain primary key value and insert into the same table with a different primary key value.
I.E. (2002,0001,001,'This is a short project.')
(2002,0001,002,'This is a short project.')
A simple INSERT statement will normally do, however, I will have many tables like this one with the same primary key fields but different additional columns. I will be looping through a list of tablenames that will be predefined. Only the primary key columns will be the same, all other columns will vary. Inotherwards, I can not hardcode the columns for the INSERT statement.
Any help would be greatly appreciated. Received on Mon Apr 15 2002 - 18:29:25 CDT