1. Avoid repeated primary keys when you want to retain the original data. Is it difficult to re-create a deleted sequence? This statement is much easier to use. Three parameters: order_sq is the sequence name. Order is the table name, and the internal primary key is id. 2. Use plslq-New-test window to test whether the statement is correct. Thank you. Oracledrop
1. Avoid repeated primary keys when you want to retain the original data. Is it difficult to re-create a deleted sequence? This statement is much easier to use. Three parameters: order_sq is the sequence name. Order is the table name, and the internal primary key is id. 2. Check whether the statement is correct. Use the pl/slq-New-test window for One-Step debugging. Thank you. Oracle drop
1. Avoid repeated primary keys when you want to retain the original data. Is it difficult to re-create a deleted sequence? This statement is much easier to use.
Three parameters: order_sq is the sequence name. Order is the table name, and the internal primary key is id.
2. You can use pl/slq-> New-> test window to perform one-step debugging. Thank you.
Oracle
drop sequence order;declarev_sql varchar2(1000);v_num number(20):=1;beginv_sql:='create sequence order_sq';select max(order_sq.id)+1 into v_num from order;if v_num is null then v_num :=1;end if;v_sql:=v_sql||' minvalue 1 maxvalue 9999999999999999999999999999 start with '||v_num ||' increment by 1 cache 20';execute immediate v_sql;end;