Subject | Re: [ib-support] TimeStamp |
---|---|
Author | Helen Borrie |
Post date | 2001-08-26T01:30:17Z |
At 06:27 PM 25-08-01 -0600, you wrote:
The WHILE assertion is tested at the beginning of the loop. CURRENT_TIMESTAMP gets you the timestamp as it is when the procedure starts:
ALTER PROCEDURE TEST
RETURNS ( T1 TIMESTAMP
, T2 TIMESTAMP )
AS
BEGIN
T1 = CURRENT_TIMESTAMP;
T2 = T1
/* Equal at start of loop
WHILE (T1 >= T2) DO
T2 = CURRENT_TIMESTAMP; /* No new value - T1 and T2 stay the same
SUSPEND; /* Take this out */
END
Try this instead:
ALTER PROCEDURE TEST
RETURNS ( T1 TIMESTAMP
, T2 TIMESTAMP )
AS
BEGIN
T1 = CURRENT_TIMESTAMP;
T2 = T1;
WHILE (T1 >= T2) DO
T2 = CAST ('NOW' AS TIMESTAMP);
END
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Please Explai Liuz,Hans:
>I don't follow :)
The WHILE assertion is tested at the beginning of the loop. CURRENT_TIMESTAMP gets you the timestamp as it is when the procedure starts:
ALTER PROCEDURE TEST
RETURNS ( T1 TIMESTAMP
, T2 TIMESTAMP )
AS
BEGIN
T1 = CURRENT_TIMESTAMP;
T2 = T1
/* Equal at start of loop
WHILE (T1 >= T2) DO
T2 = CURRENT_TIMESTAMP; /* No new value - T1 and T2 stay the same
SUSPEND; /* Take this out */
END
Try this instead:
ALTER PROCEDURE TEST
RETURNS ( T1 TIMESTAMP
, T2 TIMESTAMP )
AS
BEGIN
T1 = CURRENT_TIMESTAMP;
T2 = T1;
WHILE (T1 >= T2) DO
T2 = CAST ('NOW' AS TIMESTAMP);
END
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________