We have a program on V5R3 with imbedded SQL that looks something like this:
EXEC SQL
SELECT MYVAL FROM MYTABLE
WHERE MYVAL BETWEEN :VAL1 and :VAL1 + 10 ;
It then proceeds to Fetch said value into VAL1.
(There's more to it but this is the area of focus.) Now, personally I
thought this would re-evaluate that BETWEEN value with each FETCH. But that
doesn't appear to be happening; if VAL1 is 5 when the process starts, it
will not fetch rows where VAL1 >= 15 - even if Val1 represents a series of
contiguous numbers in that table. This latter is the effect the programmer
wanted, but I distrust it (and don't like its inclarity in any case). I
thought it should keep going since 16 is between (the current VAL1) and (the
current VAL1+10).
Is this function operating by documented design? I've perused the SQL
manuals on this, but cannot seem to find a definitive description.
Thanks
Dennis E. Lovelady
AIM/Skype: delovelady MSN: fastcounter@xxxxxxxxxxxx
<
http://www.linkedin.com/in/dennislovelady>
www.linkedin.com/in/dennislovelady --
No time spent with a cat on your lap, can ever be considered 'wasted.'
As an Amazon Associate we earn from qualifying purchases.