Change NLS_DATE_FORMAT via logon triggers

NLS_DATE_FORMAT is a parameter heavily dependent on a session. A good practice is to write a logon trigger depending on the application requirement to set this parameter write at the session logon. It can be done via a small script for a logon trigger.


CREATE OR REPLACE TRIGGER SCOTT.CHANGE_DATE_FORMAT
 AFTER LOGON ON DATABASE
WHEN (
USER='SCOTT'
 )
begin
execute immediate 'alter session set nls_date_format = ''DD/MM/YYYY HH24:MI:SS'' ';
end ;
/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s