CUURENT in Stored Procedure
Posted in 2006
I use SCO OpenServer 5.x and Informix 7.x
My USEOSTIME is set to 1 (Seems if this only enable the fraction part)
The date_stamp is declared as DATETIME YEAR TO FRACTION(5)
Maybe this question was asked before, but I would like to ask it again.
If I use CURRENT at different places in a stored procedure, I get the
same values. I would like the Stored Procedure to log in milliseconds
the time it takes to execute. I would like to get the time in the
beginning and then also at the end of the procedure.
I have replaced the CURRENT with another stored procedure that I call
that use CURRENT, but no luck. Any help please?
Example:
CREATE PROCEDURE sp_check_speed()
DEFINE l_start_time DATETIME YEAR TO FRACTION(5); DEFINE l_end_time DATETIME YEAR TO FRACTION(5);
LET l_start_time = CURRENT;
{Do lot of work and selects, take about 3 second}
LET l_end_time = CURRENT;
{Write the Start and End time into a table, but the time is the
same}
END PROCEDURE;
Regards
David