Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> enable SQL trace with trigger?

enable SQL trace with trigger?

From: Royce Lithgo <roycel_at_bml.com.au>
Date: Sun, 11 Jul 1999 09:54:16 +1000
Message-ID: <W9Rh3.1848$1u.18017@ozemail.com.au>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US