sql - How to create a sequence with start with value that is a query -
i saw same question here create sequence start query not work. has 12 votes i'm not sure why it's not working me.
this have:
declare l_new_seq integer; begin select max(expense_detailid) + 1 l_new_seq expense_detail; execute immediate 'create sequence expense_detail_seq start ' || l_new_seq || ' increment 1'; end; /
and error get:
ora-06550: line 3, column 17: pls-00103: encountered symbol "create sequence expense_detail_seq start " when expecting 1 of following: := . ( @ % ; symbol ":=" substituted "create sequence expense_detail_seq start " continue. (dbd error: error possibly near <*> indicator @ char 27 in ' begin immediate <*>'create sequence expense_detail_seq start ' || l_new_seq || ' increment 1'; end; ') ora-00900: invalid sql statement
any ideas? thanks!
make text in single line. or @ least each literal.
also, product/utility , product version ?
Comments
Post a Comment