Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sequences

Re: Sequences

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Sat, 21 Jul 2001 21:41:46 +0200
Message-ID: <9jclrv$5b9$1@ctb-nnrp2.saix.net>

"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.

--
Billy
Received on Sat Jul 21 2001 - 14:41:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US