jueves, 3 de octubre de 2013

Problem getting the day of the week varies in america (sunday 1) and spain (sunday 7)

If you have the territory to america,
you get sunday as 1

if you have the territory to spain
you get sunday as 7

To solve this problem you can create a trigger on logon to set the territory.



CREATE OR REPLACE TRIGGER TGR_SET_REGIONAL
 AFTER
 LOGON
 ON DATABASE
BEGIN
 execute immediate 'ALTER SESSION SET NLS_TERRITORY=''AMERICA''';
 END;
/

No hay comentarios.:

Publicar un comentario