Subject RE: [firebird-support] Re: Exact timestamp w/o using UDF?
Author Helen Borrie
At 02:31 PM 9/10/2006, Alan McDonald wrote:

>quite... it's current for the operation - not the transaction
>another difference:
>SELECT CURRENT_TIMSTAMP FROM TABLE works but
>SELECT NOW FROM TABLE

Doesn't work because 'NOW' is a date literal and must be quoted

>or SELECT 'NOW' FROM TABLE
>does not work

Doesn't work in ODS 10 and higher, to the extent that it returns the
string 'NOW'.

Likewise, SELECT '25.12.2006' FROM RDB$DATABASE will return the
string '25.12.2006'.

But, consistently with the various alphanumerical date/time literals,
it does work if the literal is cast. Both of the following return
date/time types:

SELECT CAST('NOW' AS TIMESTAMP) FROM RDB$DATABASE
SELECT CAST('24.12.2006' AS DATE) FROM RDB$DATABASE

>UPDATE TABLE SET FIELD='NOW' WHERE....
>does work however.

The same as
UPDATE ATABLE SET ADATEFIELD = '24.12.2006' does work - a prepared
DML operation knows the data type of the column it is writing to, so
it knows this quoted thing it is looking at is not a string.

./heLen