Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting currval from a sequence with out incrementing nextval
Current value of sequence you can obtain in this way:
DECLARE
curr_val NUMBER;
BEGIN
SELECT my_seq.CURRVAL
INTO curr_val FROM DUAL;
But i would prefer to leave checking of unique constraint on Oracle. What if your check on id 100 passed, but after that moment someone insert 100 too, and you than insert 100 again.
Martin Received on Fri Mar 03 2006 - 18:06:49 CST