Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sysdate function - possible to override

Re: sysdate function - possible to override

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Wed, 28 Feb 2007 14:17:55 -0600
Message-ID: <45e5d6e7$0$16391$88260bb3@free.teranews.com>


Luch wrote:
> On Feb 28, 2:28 pm, Brian Peasland <d..._at_nospam.peasland.net> wrote:

>> Since this is in development, does it really matter if their activity is
>> "off"? They aren't working on real data anyway.

>
> Yes, it does... What I mean is that the developer uses SYSDate, and
> doesn't notice any problem. When our program is deployed to customers,
> the sysdate function call is still there (instead of the one he
> should've been using) and the customer sees the error. Of course the
> real solution is the programmer should be calling our own function to
> return the current datetime instead of using sysdate. I want to block
> them from using sysdate.
>
>
>> Have you thought about setting their session's timezone?
>>
>> ALTER SESSION SET TIME_ZONE= '[+|-]hh:mm'
>>                              | time_zone_region
>>
>> The data may be stored in the database's local time zone, but the
>> session can do a conversion as it is working with the data.
>>

>
> So if this is done when the session is established, and a call to
> sysdate is done, it will return the current datetime in the timezone I
> manipulate it to return it as?
>
>

Yes.

This way, Oracle handles the timezone differences and you do not have to   worry about coding your own functions.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown

-- 
Posted via a free Usenet account from http://www.teranews.com
Received on Wed Feb 28 2007 - 14:17:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US