I have an ORACLE sequence generator that periodically has to be reset (it feeds into a fixed-length field of a COBOL app). I do this by running a script that drops the sequence and the creates it:
My question is two-fold:
1) Is there a way to alter the sequence without dropping and recreating it?
2) Is there a way to create a stored procedure that performs this action?
Code:
DROP SEQUENCE RCPTNUM_SEQ;
CREATE SEQUENCE RCPTNUM_SEQ
START WITH 1
MAXVALUE 99999
MINVALUE 1
NOCYCLE
NOCACHE
NOORDER;
1) Is there a way to alter the sequence without dropping and recreating it?
2) Is there a way to create a stored procedure that performs this action?