Posted on Leave a comment

Advance Sequence Nextvals to sync with table

Here’s a way to advance a sequence using an anonymous PL/SQL block:

DECLARE
mn integer;
mx integer;
BEGIN
SELECT MYPROJ.personnelid_seq.CURRVAL INTO mn FROM DUAL;
SELECT max(personnelid) INTO mx FROM MYPROJ.personnel;
WHILE mn

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.