Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: ALTER SESSION query ?

    Hi,

    ALTER SESSION SET NLS_DATE_FORMAT = 'YY-MM-DD HH24:mi:ss'.

    Could you please explain what the above query does. What is the effect of changing this date format. After executing the above query, how can I feel the difference through executing anyother queries related to the date format ?

    Please advice,

    Thanks,
    Sam

  2. #2
    Join Date
    Feb 2004
    Posts
    143
    SELECT SYSDATE FROM DUAL

    27-JUL-04

    After this,
    ALTER SESSION SET NLS_DATE_FORMAT = 'YY-MM-DD HH24:mi:ss' ;

    Statement processed


    After this,

    SELECT SYSDATE FROM DUAL

    04-07-26 23:51:04


    What exactly is happening during the Alter session command is that you are explicity changing the format model Oracle has automatically or implicitly assigned.

    Hope this answers

  3. #3
    Join Date
    Feb 2004
    Posts
    143
    In the first query
    select sysdate from dual

    26-JUL-04

    (sorry..,,,not the 27th...hum...yawn..... )

    And after the alter session command

    SELECT SYSDATE FROM DUAL

    04-07-26 23:51:04

  4. #4
    Join Date
    Mar 2004
    Posts
    205
    Hi,

    Thanks for your reply.

    Only from the following I could see the effect :

    select to_char(sysdate) from dual; ( after ALTER SESSION is executed )


    Thanks,
    Sam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •