Getting sequence number using ADO 
Author Message
 Getting sequence number using ADO

Hi Paul,

you can get the last sequence number like this : SELECT YourSequence.CURRVAL

you don't have to lock the table, CURRVAL is the last sequence number for
the current session.



>I am writing a VB program using ADO to access an Oracle database.
>Primary keys are generated using sequences. When a row is inserted I
>want to find the sequence number just generated. Is the best approach
>to this to lock the table before doing the insert, get the sequence
>number and then release the lock? If so how do I do this with ADO?
>Thanks in advance.

Sat, 11 Aug 2001 03:00:00 GMT
 [ 1 post ] 

 Relevant Pages 

1. getting a sequence number

2. Getting correct sequence numbers in a table.

3. ADO Recordset for getting Oracle sequence.NEXTVAL

4. Blob using SQLPutData: getting Function Sequence Error

5. Risk in using sequence number?

6. Retrieve a sequence number using a cursor

7. Getting line number of error in ADO

8. record number/sequence number in MSAccess table

9. Getting number of rows transformed from a data pump task using VB

10. Getting a Random number without using RAND()

11. Getting PORT numbers used by Unidata ODBC

12. Using ADO with Oracle's Sequence command (NextVal)

Powered by phpBB® Forum Software