What wrong here? I'm looking the simplest way to realise sequence nextval over true primary key ID, stored into the table
DECLARE
smth NUMBER;
LOOP
smth := (select gen_ns_ces_id.nextval from dual);
EXIT WHEN smth > (select MAX(ID_NS_WORK) from CES.NS_CES)
END LOOP;
CREATE SEQUENCE "CES"."GEN_NS_CES_ID" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 2 START WITH 1837 NOCACHE NOORDER NOCYCLE ;
ID NAME
1845 JONNY
.. ....