
Getting sequence number using ADO
Hi Paul,
you can get the last sequence number like this : SELECT YourSequence.CURRVAL
FROM DUAL
you don't have to lock the table, CURRVAL is the last sequence number for
the current session.
HTH,
Philippe
Quote:
>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.