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: PL/SQL HELP NEEDED!!!!

Re: PL/SQL HELP NEEDED!!!!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 17 Jun 1999 11:04:12 GMT
Message-ID: <3768d5df.616356@newshost.us.oracle.com>


A copy of this was sent to Barney Gumble <duff.drinker_at_cornerpub.FUDD-SUX> (if that email address didn't require changing) On Thu, 17 Jun 1999 09:59:07 +0200, you wrote:

>So what you are saying, I could make proc like:
>

yes.

>Procedure blabla (xxxx NUMBER) AS
>
>BEGIN
> INSERT INTO MyTable (var1, var2)
> VALUES (seq.NextVal, xxxx);
>
> INSERT INTO NewTable (var1, var2)
> VALUES (seq.CurrVal, xxxx);
>... and so on...
> COMMIT;
>END;
>
>What if there are several users with the same logon ID?
>

they each have their own SESSION, their own transactions. they will not see each others 'currval' values.

this is what sequences were designed for -- highly concurrent use by many sessions. nextval and currval are session specific, you might have 1,000 sessions each with the same username but their each have their own 'currval' values.

> BG :O)
>
>Thomas Kyte wrote:
>
>> currval and nextval are SESSION specific. When you get a nextval -- currval
>> will also return YOUR currval -- never anyone elses. currval would be utterly
>> useless if it returned anything other then your last NEXTVAL...

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

Current article is "Fine Grained Access Control", added June 8'th  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jun 17 1999 - 06:04:12 CDT

Original text of this message

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