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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: nextval increments by 2 in pl/sql procedure

RE: nextval increments by 2 in pl/sql procedure

From: <torben.holm_at_miracleas.dk>
Date: Wed, 14 Aug 2002 04:28:24 -0800
Message-ID: <F001.004B4216.20020814042824@fatcity.com>


Where do you call your procedure?
If you are running the code through IAS you (ias) will start more than one session (if you are using SSO), so depending on where you are calling your procedure it migth be called more than once. Could you please give some more information.

/torben
>-- Original Message --
>Date: Tue, 13 Aug 2002 14:34:13 -0800
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Reply-To: ORACLE-L_at_fatcity.com
>From: "Danny Hughes" <DHUGHES_at_knobias.com>
>Subject: nextval increments by 2 in pl/sql procedure
>
>
>hello all,
>
>I have a pl/sql procedure that selects the nextval from a sequence. The
>problem is that it incrrements the sequence by 2 in a pl/sql procedure.

>If I select the nextval from a sqlplus session, it works fine.
>
>here is partial code that I am using.
>
>PROCEDURE NEWTRANSACTION (v_storyid IN story.story_id%type,
> v_transid OUT story_transaction.trans_id%type
>) IS
>
>BEGIN
> select story_transaction_seq.nextval into v_transid from dual;
>.....
>END
>
>for debugging purposes, I made that code look like...
>
>PROCEDURE NEWTRANSACTION (v_storyid IN story.story_id%type,
> v_transid OUT story_transaction.trans_id%type
>) IS
>
>v_value1 NUMBER; --debug code
>v_value2 NUMBER; --debug code
>
>BEGIN
> select story_transaction_seq.currval into v_value1 from dual; --debug
code
> select story_transaction_seq.nextval into v_transid from dual;
> select story_transaction_seq.currval into v_value2 from dual; --debug
code
>
>.....
>END
>
>
>when I ran this, v_value1 had a 200, v_transid had a 201, and v_value2
had
>a 202
>
>taking the debug code out and hitting that procedure with a web page will
>increment the v_transid by 2 each refresh of the page.
>
>am i doing something wrong? I can't find any information on the web related
>to this issue.
>
>TIA
>
>
>Danny Hughes
>DBA
>Knobias.com
>601-978-3399 x103
>dhughes_at_knobias.com
>www.knobias.com
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Danny Hughes
> INET: DHUGHES_at_knobias.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).



Torben Holm
Miracle A/S

Mobil : +45 2527 7104
torben.holm_at_miracleas.dk
http://miracleAS.dk

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: torben.holm_at_miracleas.dk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 14 2002 - 07:28:24 CDT

Original text of this message

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