Subject Strange timestamp math w/ FB 2.5
Author Rick Debay
I'm trying to do performance tracing and I'm getting strange numbers. A
stored procedure that runs for over sixteen seconds is being logged as
running for 0.0002 seconds.
Does anyone have any ideas as to what I could be doing wrong?

CREATE TABLE PERF_TRACE
(
PROC VARCHAR(32) NOT NULL,
DURATION DECIMAL(18,4) NOT NULL,
CONSTRAINT PK_PERF_TRACE PRIMARY KEY (PROC)
);

PROC DURATION
--------------
TEST 0.0000

DECLARE VARIABLE STRT TIMESTAMP;
...
STRT=CAST('NOW' AS TIMESTAMP);
/* runs for 16.703 seconds */
UPDATE PERF_TRACE p SET p.DURATION = p.DURATION + (CAST('NOW' AS
TIMESTAMP) - :STRT) WHERE p.PROC='TEST';

PROC DURATION
--------------
TEST 0.0002

Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.