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?