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



Hello Jeff,

I have seen it indicated in many posts in the past that if you are using cursors
in SQL, you are doing something wrong.

Huh?! How do you read rows without a cursor?!! I wonder if you're taking a comment out of context?


If I have only RPGLE and CL to work with and SQL-CLI is not an option, how would
I select multiple rows for a set of conditions and return them in an ordered
condition using embedded SQL with a CURSOR?

Sorry -- are you asking how to do it _with_ a cursor? (This seems to contradict your previous sentence, in which you said you shouldn't use a cursor.)

Can you clarify what you're asking?

Also, you say CLI is not an option. CLI may be more complex than embedded SQL (because there's no precompiler to do part of the work for you) but why wouldn't it be an option? (CLI is part of the core OS, it's always there...) Please understand that I'm *not* recommending CLI at this time, merely pointing out that it's always an option. Embedded SQL is usually an easier choice.

But to read multiple rows in an order with conditions, you will need to use a cursor (in both embedded and CLI) and I don't understand why you say a cursor is wrong.

And I'm not sure if you're asking how to use a cursor? Or what you're asking?

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.