Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Dynamic SQL works in 8.1.5, "ORA-01722: invalid number" in 8.0.4.
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);
![]() |
![]() |