Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    Reston, VA
    Posts
    59

    Unanswered: Change SYSDATE by schema

    Hello,

    I was just wondering if there was a way to change the SYSDATE by schema. I know SYSDATE can be altered, but wouldn't it change SYSDATE for all schemas?

    thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    I haven't tried this, but you could create an 'after logon' trigger on each schema that sets the time zone:
    Code:
    Create Or Replace Trigger Logon_Trg
    After Logon On SCHEMA
    Begin
      Execute Immediate 'ALTER SESSION SET TIME_ZONE = ''-05:00''';
    End;
    /
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Aug 2003
    Location
    Reston, VA
    Posts
    59
    Thanks for the response! I really appreciate it.

    I suppose I envisioned a setting rather than a trigger, but I don't even know if that's possible (obviously, or I wouldn't be posting here), but I think this is pretty good solution. Plus, it's safer than messing around with any system-wide properties. I'll see what the powers that be think and post back.

    In the meantime, if other ideas exist, pass them along.

  4. #4
    Join Date
    Aug 2003
    Location
    Reston, VA
    Posts
    59
    Okay, I did some more research regarding SESSION. SYSDATE is NOT something that be altered by session. It only reads the actual system date (hence, the name...ha ha), or a static date from an Oracle configuration file.

    To give a bit more background, we're looking to test some old code which uses SYSDATE in some queries as a timestamp.

    I appreciate the help though...thanks!

Posting Permissions

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