« Fading alerts in JavaScript | Home | List the tablespaces in backup mode »

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;

Topics: Oracle, output | Submitter: checkthis

Comments

You must be logged in to post a comment.