ここで同じ質問を見ましたクエリからのSTART WITHでシーケンスを作成しますが、機能しません。賛成票が 12 票あるので、なぜうまくいかないのかわかりません。
これは私が持っているものです:
declare
l_new_seq INTEGER;
begin
select max(expense_detailid) + 1
into l_new_seq
from expense_detail;
execute immediate 'create sequence expense_detail_seq
start with ' || l_new_seq || ' increment by 1';
end;
/
そして、これは私が得るエラーです:
ORA-06550: line 3, column 17:
PLS-00103: Encountered the symbol "create sequence expense_detail_seq start with " when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "create sequence expense_detail_seq start with " to continue. (DBD ERROR: error possibly near <*> indicator at char 27 in '
BEGIN
immediate <*>'create sequence expense_detail_seq start with ' || l_new_seq || ' increment by 1';
END;
')
ORA-00900: invalid SQL statement
何か案は?ありがとう!