Re: Current function does not work!
Posted in 1998
Wolf Peter wrote:
>
> HOW can I GET the real current time in stored procedure call?
>
> These test program proofs that the built-in current function in a stored
>
> procedure the procedure returns the time when the procedure BEGAN not
> the CURRENT time!
>
> create procedure test() returning datetime year to second;>
> define i int;
>
> for i= 1 to 5
> return current do with resume;
> system( 'sleep 3' );
> end for;
>
> end procedure;
>
> The execute procedure test()
> returns
> 1998-07-13 11:33:53
> 1998-07-13 11:33:53
> 1998-07-13 11:33:53
> 1998-07-13 11:33:53
> 1998-07-13 11:33:53
>
> Please send the answers to my e-mail and not only to the message group.
The SQL-92 standard defines the time of evaluation of CURRENT_TIME (=
Informix CURRENT) during the execution of a statement to be
implementation dependent.
As SQL is a set-oriented language, not a procedural language, it makes
sense to have CURRENT give the same time throughout the duration of a
transaction.
There might be an argument for having another function to return a
different time each time it is evaluated. This might make foreign key
relationships that use the time tricky to create...
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
---
If all else fails, read the instructions.
All opinions are my own and not those of Bayer plc.
My Internet plumbing does not allow me to mail and post news together.
Sorry.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/