Subject RE: [IBO] TIMESTAMP question
Author Don Schoeman
Thx for that info, that might explain the problem I had. The reason why I
asked is that I record information from a hardware device and then store the
information into a "HISTORY" table. I use a TIMESTAMP field as part of the
primary key. I noticed however that when I try and insert data too quickly,
I get a primary key violation. I have resolved this issue for now by making
sure that data is not inserted quicker than 15ms apart. Currently I'm not
using 'NOW' when the inserting is performed but supply my own timestamp like
this: DSQL.ParamByName('P_TIMESTAMP').AsDateTime := Now; I'm now wondering
if it will make a difference if I use 'NOW' on a BEFORE INSERT trigger
instead?

Regards,
Don Schoeman


-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 10 December 2004 08:58 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIMESTAMP question


At 08:39 AM 10/12/2004 +0200, you wrote:

>As far as I know, a Firebird TIMESTAMP field is a 64bit field, am I
correct?

No. Actually, it is two 32-bit signed integers, although you never have
need to know that, or understand how the engine resolves these numbers
internally. Unlike with Paradox, you can't take a number and resolve it to
a timestamp.

>Does anyone know whether this includes the milliseconds such as Delphi's
>TDateTime type variables?

A timestamp's subsecond part is ten-thousandths of a second. You need to
be aware that the server time, e.g. CURRENT_TIMESTAMP, 'NOW', etc., is
always stored with zero in the subseconds part. You can access the exact
timestamp only by using the external function GetExactTimestamp(), which
takes no argument. You will find it in fbudf.

Helen




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !


Yahoo! Groups Sponsor
ADVERTISEMENT






Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/

To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.