Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: procedure and ddl commands?
thank you for sugesstions, but this all was not code from procedure,
I just send stupid mix of code what I need;
part of index is not in this procedure,
and I saw in messages before that
all DDL commands have to be in ' EXECUTE IMMEDIATE' statement
(this index is only why I use value from table into sequence)
I know for procedure exception, but this was not what I was interested
I tryed my start procedure like :
IS
nNewSNo number;
BEGIN
SELECT max(SNo)+1 INTO nNewSNo FROM testtable1;
EXECUTE IMMEDIATE 'CREATE SEQUENCE testsequence
INCREMENT BY 1
START WITH :1
MINVALUE 1
MAXVALUE 999999
CYCLE
NOORDER
NOCACHE'
using nNewSNo;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered -
'||SQLCODE||' -ERROR- '||SQLERRM);
END;
and start it with :
but I had exception
ORA-20001: An error was encountered - -1722 -ERROR- ORA-01722: invalid
number ORA-06512: at line 8
I change select statement with "SELECT 1 into nNewSNo FROM dual;"
and had same exception
Where is problem?
thanks Received on Thu Jul 29 2004 - 03:46:32 CDT