My external scalar function is DETERMINISTIC.
From the SQL Redbook DB2 Universal Database for iSeries SQL Reference, that means that the function will always return the same result from successive invocations with identical input arguments. That likely infers a function cache and that the function is not carried out again on successive calls with same args. Okay so,
My function is called today and returns some value. The day after it is called again with identical args. Is the function carried out again the day after ?
For example :
Function "FUNCTION1" is DETERMINISTIC and uses the current date, to get a previous month date.
I call it today and as a result I get say Sep 13 2008. So far so good.
I call it again the day after. What do I get ? Sep 13 or Sep 14 ?
Also can the results change if the function is called from different sql statements the same day and the day after ?
When is the cache cleared ?
Hopefully this post makes sense.
If anybody can shed some light on this, I'd appreciate it.
Thanks.
From the SQL Redbook DB2 Universal Database for iSeries SQL Reference, that means that the function will always return the same result from successive invocations with identical input arguments. That likely infers a function cache and that the function is not carried out again on successive calls with same args. Okay so,
My function is called today and returns some value. The day after it is called again with identical args. Is the function carried out again the day after ?
For example :
Function "FUNCTION1" is DETERMINISTIC and uses the current date, to get a previous month date.
I call it today and as a result I get say Sep 13 2008. So far so good.
I call it again the day after. What do I get ? Sep 13 or Sep 14 ?
Also can the results change if the function is called from different sql statements the same day and the day after ?
When is the cache cleared ?
Hopefully this post makes sense.
If anybody can shed some light on this, I'd appreciate it.
Thanks.
Comment