I'm new in PL/SQL in Oracle and what I've tried so far doesn't work
I want to get the max(id)
of my table... And then create a SEQUENCE which starts with this maxID+1
DECLARE maxId NUMBER;
BEGIN
SELECT max(id)+1 INTO maxId FROM TABLE;
CREATE SEQUENCE "DB"."SEQ_TABLE" MINVALUE 1 MAXVALUE 999999 INCREMENT BY 1 START WITH maxId CACHE 20 NOORDER NOCYCLE;
END;
/
But I can't use CREATE
here ...
How can I achieve this ?