Hello:

Can anyone explain to me what exactly 'Alter Session' will do?
Will it alter the session all the way until it close?
How do I find out what kind of mode is my SQLPLUS session currently on?

I have following script like:

ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD-HH24.MI.SS';
SELECT ...
FROM ...
WHERE ...
     (TO_DATE(SUBSTR(KOMP.DATCRE,1,19),'YYYY-MM-DD-HH24.MI.SS') <  TO_DATE(SUBSTR(KOMP.DATCHG,1,19),'YYYY-MM-DD-HH24.MI.SS')) and
     (TO_DATE(TO_CHAR(SYSDATE-1),'YYYY-MM-DD-HH24.MI.SS') <  TO_DATE(SUBSTR(KOMP.DATCHG,1,19),'YYYY-MM-DD-HH24.MI.SS'));

When I run the script as above, it will only return 2 records, which is correct.

However, when I remove "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD-HH24.MI.SS';"
the query will return 8000 records which is wrong.

What function does 'ALTER SESSION' have here?

Thanks

 



Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices!

Reply via email to