Home » SQL & PL/SQL » SQL & PL/SQL » How to change System Date
How to change System Date [message #203104] Mon, 13 November 2006 22:29 Go to next message
mudalimuthu
Messages: 64
Registered: May 2005
Location: Bangalore
Member
How to change System Date through triggers ?
is it possible ?

regards
muthu
Re: How to change System Date [message #203128 is a reply to message #203104] Tue, 14 November 2006 00:12 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


Better you take a look at the following links ..

http://www.google.co.in./search?hl=en&q=+what+is+sysdate+%3F+%2B+oracle&meta=
http://www.google.co.in./search?hl=en&q=trigger+%2Boracle&meta=

regards,
Rajuvan.

[Updated on: Tue, 14 November 2006 00:14]

Report message to a moderator

Re: How to change System Date [message #203159 is a reply to message #203128] Tue, 14 November 2006 02:38 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
That's not actually a lot of help to the OP, really. It tells him nothing about how to use triggers to change Sysdate.

There is no good way of achieving this.
There is a system parameter called FIXED_DATE. If you set this, then all calls to sysdate return that value. The problem is that it is fixed - it does not increase as time passes.

You could write a piece of Java that would shell out to the OS and change the system clock there, which would then be reflected in the sysdate

The best approach would probably be to create a function that returns sysdate plus an adjustment, and to use this instead of sysdate. That way you can use whatever trigger you were thinking of creating to simply change the adjustment in this function.

[EDIT] Fixed URL; your link lead to nowhere (Littlefoot)

[Updated on: Tue, 14 November 2006 02:51] by Moderator

Report message to a moderator

Re: How to change System Date [message #204102 is a reply to message #203104] Fri, 17 November 2006 16:42 Go to previous messageGo to next message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
I think the real problem is to ask what is wrong with your SYSDATE. If it is wrong, then simply contact the system admin for the database server and ask then to set the correct time on the server. Also suggest that they look into using NTP (http://www.ntp.org/) to keep it correct.
Re: How to change System Date [message #204143 is a reply to message #204102] Sat, 18 November 2006 03:22 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
If someone asks how to change the systemdate through triggers, it is very likely there is nothing wrong with their actual systemdate/time, but they want to be able to 'time-travel' for testing purposes..
Previous Topic: problem with ordimage
Next Topic: PL/SQL problem
Goto Forum:
  


Current Time: Sun Dec 04 08:29:28 CST 2016

Total time taken to generate the page: 0.11160 seconds