RE: How Can I get A sequence Current Value in PROC
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 your_sequence.CURRVAL INTO your_variable FROM dual; ... HTH Iulian -Original Message- Sent: Monday, November 26, 2001 2:50 PM To: Multiple recipients of list ORACLE-L ** This email has been tested for viruses by F-Secure Antivirus administered by IT Network Department. ** Hi when writing a program PROC sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). ** The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful. Mobil Rom is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt. ** -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: How Can I get A sequence Current Value in PROC
.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 sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). ___ This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of SchlumbergerSema. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify the SchlumbergerSema Helpdesk by telephone on +44 (0) 121 627 5600. ___ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: FOX, Simon INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
Re: How Can I get A sequence Current Value in PROC
Yes, sequenceName.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 another session, CURRVAL in the original session will relate to the previous call to NEXTVAL in the original session - it does not increment. - Bill. At 04:50 26/11/01 -0800, you wrote: Hi when writing a program PROC sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bill Buchan INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: How Can I get A sequence Current Value in PROC
Or I think you can query the dictionary SELECT last_number INTO your_variable FROM user_sequences WHERE sequence_name = UPPER(your_sequence) 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, 2001 4:30 PM To: Multiple recipients of list ORACLE-L 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 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 your_sequence.CURRVAL INTO your_variable FROM dual; ... HTH Iulian -Original Message- Sent: Monday, November 26, 2001 2:50 PM To: Multiple recipients of list ORACLE-L ** This email has been tested for viruses by F-Secure Antivirus administered by IT Network Department. ** Hi when writing a program PROC sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). ** The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful. Mobil Rom is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt. ** -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: How Can I get A sequence Current Value in PROC
I don't know But You can get last_number from dba/user_sequences view I just looked at this view and found some interesting results If sequence is nocache then it seems last_number really is the last number But if some sequence values are stored in cache then last number values are something like starting_value + n * increment_by * cache_size enjoy!!! :-) I don't know if it is written somewhere in the docs. Gints Plivna IT Sistçmas, Meríeïa 13, LV1050 Rîga http://www.itsystems.lv/gints/ Cale, Rick T (Richard)To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] RICHARD.T.CALE cc: @saic.comSubject: RE: How Can I get A sequence Current Value in PROC Sent by: [EMAIL PROTECTED] m 2001.11.26 16:30 Please respond to ORACLE-L 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 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 your_sequence.CURRVAL INTO your_variable FROM dual; ... HTH Iulian -Original Message- Sent: Monday, November 26, 2001 2:50 PM To: Multiple recipients of list ORACLE-L ** This email has been tested for viruses by F-Secure Antivirus administered by IT Network Department. ** Hi when writing a program PROC sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). ** The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful. Mobil Rom is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt
Re: How Can I get A sequence Current Value in PROC
Hi Yes. Try sequenceName.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 sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). - This Mail has been checked for Viruses Attention: Encrypted mails can NOT be checked! ** Diese Mail wurde auf Viren geprueft Hinweis: Verschluesselte mails koennen NICHT auf Viren geprueft werden! - -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stefan Jahnke INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: How Can I get A sequence Current Value in PROC
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). This becomes the current value to be used by that transaction. Other transactions that have not used NEXTVAL do not have a current value from that sequence (but can look at the value in the dictionary). Thanks, Harry Lowes Database Administrator, npower Northern Limited mailto:[EMAIL PROTECTED] -Original Message- Sent: 26 November 2001 15:00 To: Multiple recipients of list ORACLE-L Or I think you can query the dictionary SELECT last_number INTO your_variable FROM user_sequences WHERE sequence_name = UPPER(your_sequence) 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, 2001 4:30 PM To: Multiple recipients of list ORACLE-L 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 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 your_sequence.CURRVAL INTO your_variable FROM dual; ... HTH Iulian -Original Message- Sent: Monday, November 26, 2001 2:50 PM To: Multiple recipients of list ORACLE-L ** This email has been tested for viruses by F-Secure Antivirus administered by IT Network Department. ** Hi when writing a program PROC sequenceName.NEXTVAL points to the next value of a sequence, is there anything like sequenceName.SOMETHING that returns current value of sequence. Thanks E. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: ehsan sinavalda INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). ** The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful. Mobil Rom is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt. ** -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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