Re: Why CURRENT is working differently in 4GL and store procedure?
Posted in 1999
Girish Kagrana wrote:
>
> Why CURRENT is working differently in 4GL and store procedure?
>
> Create Procedure test_current()
> Returning integer;>
> DEFINE X DATETIME YEAR TO SECOND;
> DEFINE Y DATETIME YEAR TO SECOND;
>
> LET X = CURRENT;
>
> ..
> ..
> Delay loop of 5 minute or any interval
> ..
> ..
>
> LET Y = CURRENT;
>
> IF X = Y THEN
> Return 1;
> ELSE
> Return 0;
> END IF;
>
> End procedure;
>
> When I executed this procedure it returns me o/p 1 i.e. X and Y is same
> That means CURRENT value does not change within store procedure.
That is normal behaviour. The CURRENT time is taken when the SP is run.
It is not reset any time during execution of the SP.
> If I use the same logic in 4GL program, I find the CURRENT value is not
> same for that
> Particular program execution instant.
That is also normal behaviour. The CURRENT value is evaluated at
run-time.
Hope that helps,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com http://www.informix.com/idn |///// / //|
|http://www.iiug.org +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+