Today I came across an unexpected problem when executing an exception block inside a procedure :
My code was something like this :
insert into dc_errors (error_message,error_date) values (SQLERRM, SYSDATE);
and I allways obtain an annoying PL/SQL: ORA-00984: column not allowed here.
To solve this problem I've changed my code into :
v_exception := substr(SQLERRM, 1, 256);
insert into dc_errors (error_message,error_date) values (v_exception, SYSDATE);
with v_exception as varchar2(256) .
Tuesday, November 6, 2007
Oracle : SQLCODE and SQLERRM in Inserts
Publicada por Juanito Caminante em 9:28:00 AM
Etiquetas: Oracle
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment