Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> enable SQL trace with trigger?
Hi,
is it possible to enable SQL trace within a trigger? I'm trying to do it and I keep getting 'ORA-01031: insufficient privileges' Here is the trigger:
create trigger mb_prcs_req_aft_ins_row
after update on PSPRCSRQST for each row
DECLARE
trace_on CHAR (1) DEFAULT 'N';
BEGIN
if (:new.RUNSTATUS = 7)
then
SELECT 'Y'
INTO trace_on
FROM PS_MB_CBL_PRCS_TRC
WHERE PRCSTYPE = :new.PRCSTYPE
AND PRCSNAME = :new.PRCSNAME;
if trace_on = 'Y'
then
BEGIN
SYS.DBMS_SESSION.SET_SQL_TRACE(true);
END;
end if;
end if;
END;
I've tried using a cursor to execute "alter session set sql_trace true" and
still get the same error. If I execute that statement directly in SQL*Plus
it works fine. Only get the error when it happens in a trigger.
Thanks for any help,
Royce. Received on Sat Jul 10 1999 - 18:54:16 CDT
![]() |
![]() |