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

Home -> Community -> Usenet -> c.d.o.tools -> 8i: Procedure Questions -

8i: Procedure Questions -

From: <alvie_at_my-deja.com>
Date: Mon, 05 Feb 2001 18:14:40 GMT
Message-ID: <95mqi5$77u$1@nnrp1.deja.com>

Hi - two questions:

I need to write a procedure that 1.) INSERTS and returns the CURRVAL of a SEQUENCE and passes it to another procedure. Here's some SQL that I'm trying

CREATE PROCEDURE mySchmema.myTest_INSERT (id_myTable2 NUMBER(10) )

--local var

id_new NUMBER(10)

IS
BEGIN
    INSERT INTO mySchema.myTable

        (id_myTable
        id_myTable2
        ,col_a)
    VALUES
        (mySchema.myTable_SEQ.NEXTVAL
        ,id_myTable2
        ,'Test'   )


  --I'd like to assign CURRVAL to the variable id_new so I can   --call another procedure and pass this value to it.    SELECT OLIGOBUYER.myTable_SEQ.currval     INTO id_new
    FROM DUAL
--here's where I'd like to pass CURRVAL (id_new) to another procedure
--that is another insert like above.

END;
Also, is CURRVAL safe to use, as far not getting someone else's CURRVAL. Will it always be for the current connction?

thanks
as

Sent via Deja.com
http://www.deja.com/ Received on Mon Feb 05 2001 - 12:14:40 CST

Original text of this message

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