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 -> Dynamic SQL works in 8.1.5, "ORA-01722: invalid number" in 8.0.4.

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

From: Chapman Keyes <chapman_at_teoco.com>
Date: 25 Jul 2001 13:45:42 -0700
Message-ID: <a80c63.0107251245.762f913f@posting.google.com>

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!

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;
/ Received on Wed Jul 25 2001 - 15:45:42 CDT

Original text of this message

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