Subject Re: Timestamp fractional seconds
Author Roman Rokytskyy
Hi,

> Inserting a timestamp into Firebird:
>
> '2002-10-02 13:41:12.171'
>
> yields the following results on a select ...
> iSQL: '2002-10-02 13:41:12.171'
> IBConsole's iSQL: '2002-10-02 13:41:12'
> Firebird-Java: '2002-10-02 13:41:12'
>
> So I assume, that firebird has the exact value but the java driver
> (and IBConsole too) delivers it truncated?
>
> (same question in the following messages:
> http://groups.yahoo.com/group/Firebird-Java/message/1754
> http://groups.yahoo.com/group/Firebird-Java/message/1520
> http://groups.yahoo.com/group/Firebird-Java/message/926
> )
>
> Just wanted to ask if anybody has a workaround before I dig into
> the sources.

This is not driver issue, but core engine. If you have this table:

create table test_time(
timestamp_col timestamp
)

and you execute next statement in isql

insert into test_time values('now')

you will see that milliseconds are not there.

The only workaround that comes to my mind is to use NUMERIC(18,0)
field and store millis since 1.1.1970 (normal Java time
representation).

Best regards,
Roman Rokytskyy