Home » SQL & PL/SQL » SQL & PL/SQL » Sequence problem while using multiple union in INSERT - SELECT query.
Sequence problem while using multiple union in INSERT - SELECT query. [message #256946] Tue, 07 August 2007 04:29 Go to next message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

Query:

    Insert into temp_table (seq_reg,dynamic,static)
    ( (select seq_reg_1.NEXTVAL, '1','0' from dual)
      UNION
      (select seq_reg_2.NEXTVAL, '0','1' from dual)
    );


When i execute this query iam getting error message as follows,

[1]: (Error): ORA-02287: sequence number not allowed here


Where should i need to change the query?

Help me...
Re: Sequence problem while using multiple union in INSERT - SELECT query. [message #256949 is a reply to message #256946] Tue, 07 August 2007 04:40 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
I came across this particular issue at asktom.oracle.com yesterday. Tom Kyte pointed to this part of the documentation.

MHE
Re: Sequence problem while using multiple union in INSERT - SELECT query. [message #256955 is a reply to message #256949] Tue, 07 August 2007 04:49 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Due to sequence usage restriction (you'll find which one in the documentation), it seems that you'll have to write two separate INSERT statements.
Re: Sequence problem while using multiple union in INSERT - SELECT query. [message #257310 is a reply to message #256955] Wed, 08 August 2007 01:26 Go to previous message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

oh..ok..

Now i understood, so we need to write two seperate insert query to do.

Thanks for all...

-fortunethiyagu
Previous Topic: Stored procs..
Next Topic: Re: ORA-06530: Reference to uninitialized collection
Goto Forum:
  


Current Time: Thu Dec 08 16:22:50 CST 2016

Total time taken to generate the page: 0.17337 seconds