Subject | RE: [firebird-support] Re: Exact timestamp w/o using UDF? |
---|---|
Author | Helen Borrie |
Post date | 2006-10-09T04:57:31Z |
At 02:31 PM 9/10/2006, Alan McDonald wrote:
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 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
>quite... it's current for the operation - not the transactionDoesn't work because 'NOW' is a date literal and must be quoted
>another difference:
>SELECT CURRENT_TIMSTAMP FROM TABLE works but
>SELECT NOW FROM TABLE
>or SELECT 'NOW' FROM TABLEDoesn't work in ODS 10 and higher, to the extent that it returns the
>does not work
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....The same as
>does work however.
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