Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question re inserts
You can use insert into select..
insert into MyTable select <newKey>, Afield1, AField2..., Afieldn from MyTable where MyKey = <oldKey>;
Simply specify your oldKey and newKey values and remember the select columns must match the MyTable columns.
Hope this helps.
Pomme-granite
On 27 Aug 2003 04:42:37 -0700, johnleslie_at_madasafish.com (John Leslie) wrote:
>Not sure if this is the correct forum for this question, but here
>goes.
>
>I want create a new row in a table which is identical to an existing
>row except for the key value.
>
>Is there an easy way to do this using the Insert statement, rather
>than reading and storeing the original record and then specifying each
>value for the insert statement?
>
>JL
Received on Wed Aug 27 2003 - 09:31:58 CDT