Subject Re: [ib-support] Timestamp and CURRENT_TIMESTAMP resolution
Author Helen Borrie
At 02:19 PM 18-06-02 +0300, you wrote:
>Hello all.
>
>Does anybody know why CURRENT_TIMESTAMP returns values rounded to
>seconds?

Nobody knows why, but CURRENT_TIMESTAMP cannot return the ten-thousandths
of seconds which the Timestamp supports. It just wasn't implemented.

>How to get microseconds also?

If you have a Windows server, you can use the GetExactTimestamp UDF in the
FBUDF.dll library. Here is the declaration:

declare external function getExactTimestamp
timestamp returns parameter 1
entry_point 'getExactTimestamp' module_name 'fbudf';

If your server is not on Windows, I guess you could get the source for this
UDF from Sourceforge and write the function for Linux. :(


>Even I specify 'select cast((CURRENT_TIMESTAMP+0.5/86400) as
>varchar(32)) from table1' i have results look like *.0000 .

And even this doesn't produce the ten-thousandths of seconds:

select cast (cast('now' as timestamp) as varchar(25)) as currtime
from rdb$database

regards,
heLen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________