Pl/Sql Trigger for changing default date format in oracle -
i want ensure every time logon date format changed '24-apr-2014'
'24/04/2014'
for created pl/sql trigger follows
create or replace trigger change_date_format after logon on database begin alter session set nls_date_format = 'mm/dd/yyyy'; end; /
however not logged on sysdba perhaps thats why error
sql> @c:/pl/datetrigger.sql after logon on database * error @ line 2: ora-01031: insufficient privileges
what can ensure date format changed permanently?
your error means not allowed create such trigger. on wrong track. must set default @ database level.
setting default datetime format template
from oracle documentation
the default datetime format template specified either explicitly initialization parameter
nls_date_format
or implicitly initialization parameternls_territory
. can change default datetime formats sessionalter session
statement.
then case format must set in database initialization parameters.
to check have right value in current session:
select value v$parameter upper(name)='nls_date_format';
Comments
Post a Comment