Is there anyway to get the input parameter values, if any, bound to the a statement that caused an error in the database from a trigger? Regardless if the statement in SQL och a procedure/function call.
I'm trying to set up a log of errors on a schema level, which works fine. But I can't find a way to log the parameter values as well, and that would really be helpfull.
So far the trigger I'm using looks like this...
CREATE OR REPLACE TRIGGER t_error
AFTER SERVERERROR
ON SCHEMA
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
l_sql ora_name_list_t;
l_sequence NUMBER;
l_statement CLOB;
l_count NUMBER;
l_ts TIMESTAMP (6);
BEGIN
l_count := ora_sql_txt (l_sql);
IF l_count >= 1 THEN
FOR i IN 1 .. l_count LOOP
l_statement := l_statement || l_sql (i);
END LOOP;
END IF;
INSERT INTO oralog
VALUES (
seq_oralog.NEXTVAL,
dbms_utility.format_call_stack,
dbms_utility.format_error_stack,
dbms_utility.format_error_backtrace,
l_statement,
SYSTIMESTAMP
);
COMMIT;
END t_error;
/
Thanks