This is embarrassing, but I am going nuts here.
Today is monday. Around here, this is the first day of the week.
So,
SQL> select to_char(sysdate, 'd') from dual;
TO_CHAR(SYSDATE,'D')
--------------------
2
1 row selected.
Fine, that is probably becuase of my NLS settings:
SQL> select * from nls_session_parameters
where parameter = 'NLS_DATE_LANGUAGE';
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_DATE_LANGUAGE AMERICAN
1 row selected.
Let's change it then, into something where people know that monday is the first day of the week ;)
SQL> alter session set nls_language = german;
Session altered.
SQL> select to_char(sysdate, 'd') from dual;
TO_CHAR(SYSDATE,'D')
--------------------
2
1 row selected.
No luck, how about
SQL> select to_char(sysdate, 'd', 'NLS_DATE_LANGUAGE = danish') from dual;
TO_CHAR(SYSDATE,'D','NLS_DATE_LANGUAGE=DANISH')
-----------------------------------------------
2
1 row selected.
Wrong variable, maybe. How about NLS_TERRITORY
SQL> alter session set nls_territory = 'DENMARK';
Session altered.
SQL> select to_char(sysdate, 'd') from dual;
TO_CHAR(SYSDATE,'D')
--------------------
1
1 row selected.
Great! - But I don't like to alter session like this, and
SQL> select to_char(sysdate, 'd', 'NLS_TERRITORY = denmark') from dual:
select to_char(sysdate, 'd', 'NLS_TERRITORY = denmark') from dual
*
Error at line 1
ORA-12702: invalid NLS parameter string used in SQL function
Dang, out of ideas. Am I just on a mission impossible here?
Regards
Peter
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi