web analytics

Write to the alert log from PL/SQL code

The following undocumented function could be used to write to the alert log:

EXECUTE sys.dbms_system.ksdwrt(code, message);

Parameters:

1 – Write to trace file.
2 – Write to alertlog.
3 – Write to both.

Example:

EXECUTE sys.dbms_system.ksdwrt(2,TO_CHAR(SYSDATE, 'Dy Mon DD HH24:MI:SS YYYY')||'Hello!' );
CREATE OR REPLACE TRIGGER trg_delme
BEFORE UPDATE ON frodo.delme
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
sys.dbms_system.ksdwrt(2,TO_CHAR(SYSDATE, 'Dy Mon DD HH24:MI:SS YYYY') );
END;

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.