Difference between revisions of "PL/SQL"
From dbawiki
| Line 1: | Line 1: | ||
| + | [http://www.tutorialspoint.com/plsql/plsql_tutorial.pdf PL/SQL tutorial from tutorialspoint.com] | ||
===Write directly to the alert log=== | ===Write directly to the alert log=== | ||
| − | |||
<pre> | <pre> | ||
PROCEDURE write_alert(p_text IN VARCHAR2) IS | PROCEDURE write_alert(p_text IN VARCHAR2) IS | ||
Latest revision as of 13:23, 8 September 2016
PL/SQL tutorial from tutorialspoint.com
Write directly to the alert log[edit]
PROCEDURE write_alert(p_text IN VARCHAR2) IS
BEGIN
sys.write_log(2,p_text);
END write_alert;
Get default host name and PL/SQL program unit[edit]
PROCEDURE log_text ( p_text IN all_log_messages.text%TYPE
, p_server IN all_log_messages.server%TYPE DEFAULT utl_inaddr.get_host_name
, p_database IN all_log_messages.database%TYPE DEFAULT sys.database_name
, p_last_check IN all_log_messages.last_check%TYPE DEFAULT sysdate
, p_severity IN all_log_messages.severity%TYPE DEFAULT 'INFO'
, p_script_name IN all_log_messages.script_name%TYPE DEFAULT $$PLSQL_UNIT
);