Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

best workaround: using sequences with subqueries

336707Dec 30 2002 — edited Dec 31 2002

I'm selecting subsets of data to insert into new records.
But, it doesn't work because the primary key should be a sequence generated which can't be referenced in a subquery.
The only work around I've found is to disable the pk constraint, insert everything else, update records setting primary key = seq.nextval where null
then re-enabling the primary key constraint and any cascaded constraints. This is ugly to say the least.
Has anybody found anything else to work?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2003
Added on Dec 30 2002
2 comments
1,687 views