Subject | Re: [firebird-support] Re: Exact timestamp w/o using UDF? |
---|---|
Author | Hans |
Post date | 2006-10-09T18:10:03Z |
Adam and Helen,
Run this little procedure with 'Select * from TimeTest' and you'll see what
I mean
with Current_Time_Stamp doesn't change during execution of a procedure.
However 'now' does. Using FB1.5.3
Best Regards,
Hans
========================================================
CREATE PROCEDURE TIMETEST
RETURNS ( NOW_START TIMESTAMP
, NOW_END TIMESTAMP
, CURRENT_TIMESTAMP_START TIMESTAMP
, CURRENT_TIMESTAMP_END TIMESTAMP )
AS
Declare Variable I Integer;
Declare Variable C Integer;
BEGIN
Now_Start = 'now';
Current_TimeStamp_Start = Current_TimeStamp;
i = 10000;
while (i > 0) do
begin
select count(*) from RDB$RELATIONS into C;
i = i - 1;
end
Now_End = 'now';
Current_TimeStamp_End = Current_TimeStamp;
SUSPEND;
END
==================================================
Run this little procedure with 'Select * from TimeTest' and you'll see what
I mean
with Current_Time_Stamp doesn't change during execution of a procedure.
However 'now' does. Using FB1.5.3
Best Regards,
Hans
========================================================
CREATE PROCEDURE TIMETEST
RETURNS ( NOW_START TIMESTAMP
, NOW_END TIMESTAMP
, CURRENT_TIMESTAMP_START TIMESTAMP
, CURRENT_TIMESTAMP_END TIMESTAMP )
AS
Declare Variable I Integer;
Declare Variable C Integer;
BEGIN
Now_Start = 'now';
Current_TimeStamp_Start = Current_TimeStamp;
i = 10000;
while (i > 0) do
begin
select count(*) from RDB$RELATIONS into C;
i = i - 1;
end
Now_End = 'now';
Current_TimeStamp_End = Current_TimeStamp;
SUSPEND;
END
==================================================
----- Original Message -----
From: "Adam" <s3057043@...>
To: <firebird-support@yahoogroups.com>
Sent: Sunday, October 08, 2006 11:37 PM
Subject: [firebird-support] Re: Exact timestamp w/o using UDF?
> --- In firebird-support@yahoogroups.com, Hans <hhoogstraat@...> wrote:
>>
>> I did test, and unfortunately current_timestamp doesnt change :)
>>
>
> What version and dialect are of Firebird are you running?
>
> From Firebird 1.5.3 Dialect 3
>
> Using iSQL:
> ---
>
> SQL> select current_timestamp from RDB$DATABASE;
>
> CURRENT_TIMESTAMP
> =========================
>
> 2006-10-09 15:32:13.0000
>
> SQL> select current_timestamp from RDB$DATABASE;
>
> CURRENT_TIMESTAMP
> =========================
>
> 2006-10-09 15:32:15.0000
>
> SQL>
>
>
> ---
>
> They look pretty different to me.
>
> Note that I executed the query:
>
> select current_timestamp from RDB$DATABASE;
>
> then paused for a two seconds, pressed the up arrow and pressed enter.
>
> Obviously if you run a script with both of them it will almost always
> give you the same time for both.
>
> Adam
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> 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
>
>
>
>
>
>
>
>
>
>