Afternoon,
I had always assumed that this was because, before you get the next number
for a sequence using NEXTVAL, there ISN'T a current value. There is only the
last number generated, visible in the dictionary. NEXTVAL initialises the
current value, setting it to (LAST_NUMBER + INCREMENT_BY). T
Hi
Yes. Try .CURRVAL.
Once you've retrieved a value, you can refer to this value as often as
you want to with CURRVAL.
Regards,
Stefan
ehsan sinavalda schrieb:
>
> Hi
>
> when writing a program PROC .NEXTVAL
> points to the next value of a sequence, is there
> anything like .SOMETHING that re
Subject: RE: How Can I get A sequence
Current Value in PROC
Sent by:
Or I think you can query the dictionary
SELECT last_number
INTO
FROM user_sequences
WHERE sequence_name = UPPER()
I don't know why it's necessary to use nextval, but they state this in the
documentation.
Iulian
-Original Message-
Sent: Monday, November 26, 200
Look at 'last_number' in DBA_SEQUENCES view.
User should be granted SELECT permissions.
Igor Neyman, OCP DBA
[EMAIL PROTECTED]
- Original Message -
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Monday, November 26, 2001 7:50 AM
> Hi
>
> when writing a progra
Yes, .CURRVAL
Note that this provides the current value for the session: i.e. the value
that was last returned by NEXTVAL within that session. Therefore:
1. NEXTVAL must have been called at least once before in the session to
define CURRVAL.
2. Even if NEXTVAL is called for the sequence in a
.CURRVAL
Only works after .NEXTVAL
Simon Fox
-Original Message-
Sent: 26 November 2001 12:50
To: Multiple recipients of list ORACLE-L
Hi
when writing a program PROC .NEXTVAL
points to the next value of a sequence, is there
anything like .SOMETHING that returns
current value of sequ
Does anyone know why Oracle forces you to use NEXTVAL before doing CURRVAL.
I would think sometimes you would want to
use CURRVAL without incrementing sequence first.
Thanks
Rick
-Original Message-
Sent: Monday, November 26, 2001 8:50 AM
To: Multiple recipients of list ORACLE-L
You can
You can use another pseducolumn CURRVAL but you must use at least once per
session the NEXTVAL before using the CURRVAL or else you would get the
ORA-08002 error.
...
SELECT .CURRVAL INTO FROM dual;
...
HTH
Iulian
-Original Message-
Sent: Monday, November 26, 2001 2:50 PM
To: Multiple
Hi
when writing a program PROC .NEXTVAL
points to the next value of a sequence, is there
anything like .SOMETHING that returns
current value of sequence.
Thanks
E.
__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/
10 matches
Mail list logo