Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Dynamic SQL works in 8.1.5, "ORA-01722: invalid number" in 8.0.4.
In article <a80c63.0107251245.762f913f_at_posting.google.com>, chapman_at_teoco.com
says...
>
>Greetings!
> The following SQL works when I run it in a 8.1.5 db, but it
>generates an invalid number error when I run it in 8.0.4. Any idea
>why and how to fix it? Thanks!
>
lets see a cut and paste of this in SQLPlus along with the error message and line numbers. You don't mention what line is throwing the exception.
>DECLARE
>v_max_batchid NUMBER;
>
>vi_cursor INTEGER;
>vc_stmt VARCHAR2(200);
>BEGIN
> SELECT MAX(batchid) + 1
> INTO v_max_batchid
> FROM DPBATCHES;
>
> vi_cursor := DBMS_SQL.open_cursor;
> vc_stmt := 'CREATE SEQUENCE BATCHID_S START WITH '||v_max_batchid||'
>NOCACHE';
> DBMS_SQL.PARSE(vi_cursor,vc_stmt,DBMS_SQL.NATIVE);
> DBMS_SQL.CLOSE_CURSOR(vi_cursor);
>END;
>/
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Thu Jul 26 2001 - 08:41:25 CDT