Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle trigger after logon on database

CREATE OR REPLACE TRIGGER my_schema.trigger_name AFTER LOGON ON DATABASE
BEGIN
    INSERT INTO my_log_table
    VALUES (USER AS CONNECTED_USER,
        sys_context('USERENV', 'SESSIONID') AS SESSION_ID,
        substr(sys_context('USERENV', 'OS_USER'), 1, 50) AS OS_USER,
        substr(sys_context('USERENV', 'HOST'), 1, 30) AS HOST,
        SYSDATE AS LOGON_DATE);
END;
ALTER TRIGGER my_schema.trigger_name ENABLE;
Comment

PREVIOUS NEXT
Code Example
Sql :: change default schema sql server 
Sql :: change date format in oracle query 
Sql :: how to get duplicate records with multiple field in sql 
Sql :: find a column in all tables mysql 
Sql :: how to get nearest location in mysql with latitude and longitude 
Sql :: laravel get sql query eloquent with parameters 
Sql :: postgresql create user 
Sql :: sql server update to null 
Sql :: insert output identity 
Sql :: SQL COUNT() with DISTINCT 
Sql :: ignore case like sql 
Sql :: Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates. 
Sql :: use concat in group_concat 
Sql :: sql date diff 
Sql :: rename field name in mysql 
Sql :: create new schema mysql 
Sql :: plsql print 
Sql :: get all columns from table sql 
Sql :: how to create a table in mysql 
Sql :: sql count 
Sql :: oracle list datafiles 
Sql :: sql server select first day of previous year 
Sql :: postgresql resolv duplicate value violates unique constraint 
Sql :: DATE_SUB postgres 
Sql :: SQL Server lock table example 
Sql :: check table exist postgresql 
Sql :: get foreign table names mysql 
Sql :: oracle difference between two dates in years 
Sql :: SQL Multiple Cases 
Sql :: sqlalchemy update row 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =