Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> INSERT nextval and UNION SELECT result?
"Phil R Lawrence" <prlawrence_at_lehigh.edu> wrote in message
news:85o08c$nb8_at_fidoii.CC.Lehigh.EDU...
> I want to insert the nextval along with the results of a SELECT into a
> table. Can't seem to get the syntax right. Oracle books don't cover this
> one in the examples. I've tried:
...
> INSERT into table
> (
> dupcheckid,
> ...
> )
> select
> dupcheckid.<*>nextval,
> field1,
> ...
OK the problem here is that my SELECT is actually a UNION SELECT. If I chop off the UNION and second half, it works ok when written as above. However, it tanks with the UNION:
(
dupcheckid,
...
)
select
dupcheckid.<*>nextval, field1, ...
dupcheckid.currval, field1, .... ____________________
So, anyone know how to insert a nextval and the results of a UNION SELECT in one INSERT statement?
Thanks,
Phil R Lawrence
Received on Fri Jan 14 2000 - 15:20:34 CST
![]() |
![]() |