Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequences
"Daniel A. Morgan" <Daniel.Morgan_at_attws.com>
> > Was wondering what is the reason behind sequences not generating
> > numbers when used in a UNION. Also, why does Oracle tell you no-no and
> > perform the SQL without any errors?
>
> Please provide an example of your code. What you have writen does not
> compute for me.
No problem. Try and grok this in its fullness.
Create any sequence. Then try something like:
CREATE TABLE foobar
TABLESPACE clause
STORAGE clause
UNRECOVERABLE AS
SELECT
sequence.nextval SEQ_KEY,
col1,
col2
FROM table1
UNION ALL
SELECT
sequence.nextval,
col1,
col2
FROM table2
The SEQ_KEY column in table FOOBAR will be nulls. No ora errors.
-- BillyReceived on Sat Jul 21 2001 - 14:41:46 CDT
![]() |
![]() |