Subject Re: [firebird-support] Re: Making evaluation of UDFs constant across a query
Author Michael Ludwig
Helen Borrie schrieb am 22.03.2011 um 07:08 (+1300):
> 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

I don't get it.

select
current_timestamp,
cast( 'now' as timestamp )
from rdb$database;

Both values are always identical, as I thought.

I (mis)understood your statement as saying that CURRENT_TIMESTAMP
remains constant during a transaction (which of course it doesn't)
whereas 'NOW' remains constant during a single executing statement
(which it probably does).

So what is the *context* you're referring to in the above statement
and how do CURRENT_TIMESTAMP and 'NOW' differ in that respect?
--
Michael Ludwig