我如何用以下代码制定程序,因为冰箱中一米新元总是使用盐碱/ms,而且更容易使用。
DECLARE
temp VARCHAR2 (255);
last_val NUMBER(9, 0);
CURSOR c1 IS
SELECT DISTINCT table_name
FROM user_tab_cols
WHERE column_name = id ;
BEGIN
FOR asd IN c1 LOOP
temp := asd.table_name;
EXECUTE IMMEDIATE select NVL(max("id"),0)+1 from " ||temp|| " INTO
last_val;
BEGIN
EXECUTE IMMEDIATE drop sequence "seq_ || temp|| " ;
EXECUTE IMMEDIATE create SEQUENCE "seq_ || temp|| " MINVALUE ||
last_val||
MAXVALUE 999999999999999999999999999 INCREMENT BY 1 NOCACHE ;
EXECUTE IMMEDIATE select ||temp|| .nextval from dual ;
EXECUTE IMMEDIATE ALTER SEQUENCE "seq_ ||temp|| " INCREMENT BY 1 ;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
END LOOP;
COMMIT;
END;