Bug 3426 - Extend SQL triggers to fire on system events such as AFTER LOGON
Summary: Extend SQL triggers to fire on system events such as AFTER LOGON
Status: NEW
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: -- development
Hardware: All All
: Normal enhancement
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-31 16:12 CET by Martin van Dinther
Modified: 2016-04-11 11:46 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin van Dinther cwiconfidential 2014-01-31 16:12:03 CET
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Build Identifier: 

It would be handy to have support for (some) system event triggers, such as
CREATE TRIGGER my_logon_trigger AFTER LOGON

In Oracle you can use for instance:
CREATE OR REPLACE TRIGGER SYS.my_logon_trigger
AFTER LOGON
ON DATABASE
ENABLE
declare
v_user varchar2(30):=user;
sql_stmt1 varchar2(256) :='alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
begin
   if (v_user='Martin') THEN
        execute immediate sql_stmt1;
   end if;
end;
/

Note that this syntax is Oracle specific and NOT standard SQL.

Reproducible: Didn't try




this could resolve issue id=3322