我需要删除一个音序器并使用最后一个音序器的起始值创建另一个音序器。硬编码起始值不是一种选择。
DECLARE
NxtVal INTEGER;
BEGIN
SELECT (SEQ1.NEXTVAL)+10
into NxtVal
From Dual;
execute immediate 'Create sequence SEQ2
minvalue 1
maxvalue 99999
start with || NxtVal ||
increment by 1';
END;
/
答案 0 :(得分:1)
似乎缺少一些'
:
DECLARE
NxtVal INTEGER;
BEGIN
SELECT (SEQ1.NEXTVAL)+10
into NxtVal
From Dual;
execute immediate 'Create sequence SEQ2 '
'minvalue 1 '
'maxvalue 99999 '
'start with ' || NxtVal || -- missing '
' increment by 1';
END;
/