Subject | RE: [firebird-support] Re: Strange timestamp math w/ FB 2.5 |
---|---|
Author | Rick Debay |
Post date | 2010-10-21T15:18:40Z |
Thanks, worked like a charm. I had assumed that the math would use
seconds or milliseconds; probably my C background.
--- In firebird-support@yahoogroups.com, "Rick Debay" <rdebay@...>
wrote:
by number of seconds per day and you'll get difference in seconds. Or
use DATEDIFF built-in function.
Regards,
Vlad
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
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.
seconds or milliseconds; probably my C background.
--- In firebird-support@yahoogroups.com, "Rick Debay" <rdebay@...>
wrote:
>A
> I'm trying to do performance tracing and I'm getting strange numbers.
> stored procedure that runs for over sixteen seconds is being logged asTIMESTAMP's difference measured in days ;) So, multiply the difference
> 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
by number of seconds per day and you'll get difference in seconds. Or
use DATEDIFF built-in function.
Regards,
Vlad
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
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.