Change SYSDATE for session?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Change SYSDATE for session?

  1. #1
    Join Date
    Dec 2001
    Location
    Edmonton, Canada
    Posts
    50

    Change SYSDATE for session?

    Is it possible to change the sysdate of a particular session so that I can use the changed value of sysdate for my subsequent sql in that session.

    For example I want to do somthing like this.

    alter session set sysdate='4-APR-2004'

    and my sql in the session will use new value of sysdate.

    I know the above command will fail as alter session will only change the init.ora parameters.

    If there is any other way to acheive this please let me know!!
    An elephant is a mouse with an operating system.
    Share on Google+

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    alter system set fixed_date = '....' (whatever your nls_date_format is)

    this date then doesnt change ever so you need to unset it to resume normal operation
    Share on Google+

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Watch out! alter SYSTEM will change it for all sessions!
    Share on Google+

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    ah yes - he said session. Cant do it by session
    Share on Google+

  5. #5
    Join Date
    Aug 2000
    Location
    Jolo, Sulu
    Posts
    639
    hi Dapi...
    How did u post ur id pic there? Is it thru avatar?
    I tried attaching one but it wont display.
    Share on Google+

  6. #6
    Join Date
    Dec 2001
    Location
    Edmonton, Canada
    Posts
    50
    It is perfectly working at system level but unfortunatley nopt working at session level.
    it throws this error given below.

    alter session set fixed_date='4-apr-2004';

    ORA-02096: specified initialization parameter is not modifiable with this option
    An elephant is a mouse with an operating system.
    Share on Google+

  7. #7
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    Originally posted by davey23uk
    ah yes - he said session. Cant do it by session
    Share on Google+

  8. #8
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by kris123
    hi Dapi...
    How did u post ur id pic there? Is it thru avatar?
    I tried attaching one but it wont display.
    U urself have attached one semi nude..
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
    Share on Google+

  9. #9
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Mods, isnt there any restriction to add semi nude pics in the profile?

    Abhay
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
    Share on Google+

Posting Permissions

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


Click Here to Expand Forum to Full Width