Stored Procs & CURRENT
Posted in 1997
I have a user who is running a stored procedure which takes several hours to update (which is
OK). The last statement that is executed in the stored procedure is an:
INSERT INTO table VALUES (...,CURRENT,...);
The value in the column inserted for CURRENT (which is a datetime field) is set to the datetime
the EXECUTE PROCEDURE statement was executed, NOT the time the INSERT statement was executed
some 6 hours later.
This "feature" is documented in the SQL SYNTAX manual, and explains that the CURRENT value is
calculated when the EXECUTE PROCEDURE statement is started. What it doesn't say is whether or
not there is a workround.
The question I would like to pose is:
Does anyone know of a workround such that this can be kept in the same stored procedure ?
We are running on Online DSA 7.14.
Thanks in advance.
--
Rick Ward
Senior DBA
Great Universal Stores Home Shopping
MANCHESTER, UK