Subject | Re: Exact timestamp w/o using UDF? |
---|---|
Author | Adam |
Post date | 2006-10-09T04:15:12Z |
Just so there is no confusion:
Both 'now' and CURRENT_TIMESTAMP will change during the single
transaction. This is pretty easy to test
---
Open iSQL or equiv, and run:
select current_timestamp from RDB$DATABASE;
now wait a few seconds and run in the same window:
select current_timestamp from RDB$DATABASE;
---
But there is indeed a difference in behaviour between 'now' and
current_timestamp and it is to do with the current operation. It is
pretty easy to explain using an update statement:
update SomeHugeTable set
SomeTimestamp = 'now';
May end up having different timestamps on the first and last records
updated, while:
update SomeHugeTable set
SomeTimestamp = CURRENT_TIMESTAMP;
Will have the same timestamp on each record.
Can someone please clarify how a stored procedure or a trigger is
considered with respect to the operation that defines CURRENT_TIMESTAMP?
Adam
> >>Current_TimeStamp = Start of transaction and doesn't change till nextIs a bit misleading.
> >>Transaction is started.
Both 'now' and CURRENT_TIMESTAMP will change during the single
transaction. This is pretty easy to test
---
Open iSQL or equiv, and run:
select current_timestamp from RDB$DATABASE;
now wait a few seconds and run in the same window:
select current_timestamp from RDB$DATABASE;
---
But there is indeed a difference in behaviour between 'now' and
current_timestamp and it is to do with the current operation. It is
pretty easy to explain using an update statement:
update SomeHugeTable set
SomeTimestamp = 'now';
May end up having different timestamps on the first and last records
updated, while:
update SomeHugeTable set
SomeTimestamp = CURRENT_TIMESTAMP;
Will have the same timestamp on each record.
Can someone please clarify how a stored procedure or a trigger is
considered with respect to the operation that defines CURRENT_TIMESTAMP?
Adam