Subject Re: [firebird-support] Re: Making evaluation of UDFs constant across a query
Author Helen Borrie
At 04:58 AM 22/03/2011, Mike Pomraning wrote:
>> Hmm, is there a way in the API to determine the transactional scope of the
>> currently executing query, finer-grained than CURRENT_TRANSACTION? I
>> suppose CURRENT_TIMESTAMP effectively serves that purpose.

Not in the API, in SQL itself. Quick hints here: you test...

CURRENT_TIMESTAMP context is the CURRENT_TRANSACTION
Date literal 'NOW' context is the executing statement
UDF GetExactTimestamp() refreshes with each call to the function

>It occurs to me that this naive caching keyed on CURRENT_TIMESTAMP
>will be incorrect during some daylight savings changes, when an hour
>repeats itself. Drat.

If you need UTC time then run your server in UTC time.

./heLen