Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Dynamic SQL works in 8.1.5, "ORA-01722: invalid number" in 8.0.4.

Re: Dynamic SQL works in 8.1.5, "ORA-01722: invalid number" in 8.0.4.

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 26 Jul 2001 06:41:25 -0700
Message-ID: <9jp6m5016r4@drn.newsguy.com>

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 Corp 
Received on Thu Jul 26 2001 - 08:41:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US