On Thu, 28 Mar 2019 14:14:46 -0500, Paul Gilmartin
<0000000433f07816-dmarc-requ...@listserv.ua.edu> wrote abour Re: Using
DFSORT to generate data:

> On Thu, 28 Mar 2019 11:38:24 -0700, Sri h Kolusu wrote:
> 
>>> I'm astonished; I'd expect data bases to log times of transactions.  Or is
>>> that left the responsibility of the UI/API?
>>
>> When I say DB2 gives a static timestamp is when you are trying to get
>> EXISTING records from a DB2 table and append a time stamp. ...
>>
> OK.  I RTFM.  The term it uses in a few places is "time of the run".  I'm
> happy that means the time of the SELECT rather than time of the FETCH.

The CURRENT TIMESTAMP special register is evaluated at the time of the
first query in a transaction; likewise CURRENT TIME and CURRENT DATE.
This is not necessarily the same as the time of the SELECT.

The special registers get re-evaluated after any subsequent COMMIT or
ROLLBACK the terminates a transaction, when the next transaction begins.

> May I assume, since neither you nor Bernd said otherwise, that insertion
> of a row will use the instantaneous timestamp?

No, the INSERT will use the special register, as evaluated at the start
of its transaction. This is why TIMESTAMP data attributes are not ideal
"tie breakers" for key collisions: there are other ways to do that.

> And disappointed, that the format has a granularity of at best µsec,
> sacrificing the uniqueness of the (E)TOD clock.  Not an issue
> unless/until processors are fast enough to perform more than one
> transaction in that time.

The format was decided decades ago by a committee.

The purpose of TIMESTAMP is just its face value: to provide a temporal
log of when a database event occurred. It is a measure of external
times, rather than of the internal clock of the CPU.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
david.w.n...@googlemail.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to