× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Val1 is inspected on the open cursor. The declare is only reevaluted if
you close and reopen the cursor. The declare of the cursor isn't
executable code. It just tells the open what should be selected. That's
why you can technically put the declare someone else in your code so that
it doesn't clutter up what you are currently looking at.


--

Michael Schutte
Admin Professional



Try our new Farm-Fresh Wraps (Turkey Club, Chicken Salad and Chicken
Caesar) and Real Fruit Smoothies! Freshly prepared, wholesome and
delicious. For more information, visit www.bobevans.com





"Dennis Lovelady"
<iseries@lovelady
.com> To
Sent by: "'Midrange Systems Technical
midrange-l-bounce Discussion'"
s@xxxxxxxxxxxx <midrange-l@xxxxxxxxxxxx>
cc

04/27/2010 04:14 Subject
PM Imbedded SQL and dynamic variables


Please respond to
Midrange Systems
Technical
Discussion
<midrange-l@midra
nge.com>






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.'



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.