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

Home -> Community -> Usenet -> c.d.o.misc -> Re: INSERT nextval and UNION SELECT result?

Re: INSERT nextval and UNION SELECT result?

From: Alexander I. Doroshko <aid_at_grant.kharkov.ua>
Date: Tue, 18 Jan 2000 10:04:13 +0200
Message-ID: <8616iq$kgh@grant.grant.UUCP>


An Application Developer's Guide citation: CURRVAL and NEXTVAL cannot be used in these places:

a subquery
a view's query or snapshot's query
a SELECT statement with the DISTINCT operator a SELECT statement with a GROUP BY or ORDER BY clause a SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator the WHERE clause of a SELECT statement

So You only can try something as

 INSERT into table

     (
     dupcheckid,
     ...
     )

select
 dupcheckid.nextval, field1, ... from

    (select

      field1,
         ...
     union
     select
       field1,

    )
Phil R Lawrence <prlawrence_at_lehigh.edu> wrote in message news:85o3v2$gno_at_fidoii.CC.Lehigh.EDU... [skipped]
>
> So, anyone know how to insert a nextval and the results of a UNION SELECT
in
> one INSERT statement?
Received on Tue Jan 18 2000 - 02:04:13 CST

Original text of this message

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