
Current function within a Stored Procedure.
Quote:
> Would having another stored procedure which only updates the datetime help?
No; the value of CURRENT is 'trapped' when the containing SQL statement
starts execution, maintaining the necessary fiction that the statement
executes instantaneously.
What is needed is a user defined function which uses the gettimeofday()
system call and returns the result as a DATETIME YEAR TO FRACTION(5) value.
This could be done in IUS (IDS/UDO); not in any other version of the
engines.
Quote:
> [...inapplicable information omitted...]
> > I have a table (table_a) with two datetime columns (start_time,
> > end_time).
> > At the beginning of a stored procedure, I want to insert a row into
> > table_a setting start_time to the current datetime. The stored
> > procedure then executes a bunch of other statements that take up to
> > several hours to execute. At the end of the procedure, I want to update
> > table_a end_time to the current datetime (different than the start
> > datetime). Because the Informix 'current' function in a stored
> > procedure returns only one value, I'm having trouble registering the two
> > different times.
Yours,
Guardian of DBD::Informix -- see http://www.perl.com/CPAN