Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Logon trigger

robson_costaOct 6 2023

Hi,

I need to create a logon trigger for a user, so that when he logs in, he changes the nls_date_format. I granted the necessary privileges, but when I execute the creation it gives the message of insufficient privileges. What can it be?

The privileges I granted were: connect, create session, alter session, create trigger and administer database trigger.

The trigger I am creating is as follows:

CREATE OR REPLACE TRIGGER TG_POS_LOGON
AFTER LOGON ON DATABASE
DECLARE X DATE;
BEGIN
if (user = 'XXXXX') then
execute immediate 'alter session ste nls_date_format= ''DD/MM/YYYY''';
end if;
END;
/
Where am I going wrong?

Comments
Post Details
Added on Oct 6 2023
3 comments
7,405 views