I use a sequence to number lines. From time to time, the sequence must be reinitialized in order to be counted from another value. I try this:
DECLARE V_TEMP_NUM number(9) :=0; BEGIN V_TEMP_NUM := 15 - SEQ.CURRVAL; ALTER SEQUENCE SEQ INCREMENT BY V_TEMP_NUM; SELECT SEQ.NEXTVAL INTO V_TEMP_NUM FROM DUAL; ALTER SEQUENCE SEQ INCREMENT BY 1; END; But swears on ALTER . How to be? Generally swears at any ALTER, DROP or CREATE commands within a PLSQL block. How to execute these commands inside the block?
COLUMN_IDfield of theCOLUMN_IDsystem table will not work for you? - Dmitriyexecute immediate, but when you make so many dynamic queries (changing the sequences, and then you still have the dynamic creation of columns planned), most likely you are doing something wrong. - Dmitriy