oracle - Why does dbms_sql.parse containing incorrect PL/SQL block with bind variables succeed unexpectedly? -
the pl/sql block below fails expected:
sql> declare 2 int; 3 begin 4 := dbms_sql.open_cursor; 5 dbms_sql.parse(i,'begin dontexist; dbms_output.put(''a''); end;',1); 6 dbms_sql.close_cursor(i); 7 end; 8 / declare * fout in regel 1: .ora-06550: regel 1, kolom 7: pls-00201: identifier 'dontexist' must declared. ora-06550: regel 1, kolom 7: pl/sql: statement ignored. ora-06512: in "sys.dbms_sql", regel 1120 ora-06512: in regel 5
because don't have procedure called dontexist. question why next pl/sql block complete successfully?
sql> declare 2 int; 3 begin 4 := dbms_sql.open_cursor; 5 dbms_sql.parse(i,'begin dontexist; dbms_output.put(:a); end;',1); 6 dbms_sql.close_cursor(i); 7 end; 8 / pl/sql-procedure geslaagd.
the difference use of bind variable instead of constant, i'd know why makes difference.
this oracle 12.1.0.2
looks parse syntactic anon blocks binds, , full semantic check deferred until execution.
still, that's not behaviour want bug 26669757 raised.
wiki
Comments
Post a Comment