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



Mohammad Tanveer asked a question a week or so ago about SQL stored
procedures in RPG that piqued my interest.

Let's say as a thought exercise that I decided to design a system where
programs returned data exclusively via result sets.  This would have the
portability benefits that are always mentioned when SQL is discussed.

So, I would write "server" programs that returned result sets, and "client"
programs that asked for them.  I'm relatively comfortable with writing
EXEC-SQL statement that actually do SELECT statements, but I guess I'm not
sure about the syntax of calling a stored procedure, especially one that
accepts parameters and returns a result set.

I'm similarly in the dark about how the server program receives the
parameter data and parses it out, and how it builds the result set and
returns it, although my research so far shows that you basically create an
array of records, and return it.  It's the exact syntax there that eludes
me.

So I guess I'm looking for an end-to-end example of an RPG program using the
stored procedure syntax of SQL to call a second RPG program that returns a
result set.  If someone could point me in the right direction, I'd be much
obliged, and I think this woud answer Mohammad's question as well.  (Well,
I'm sure it's overkill for his question, but then I'm nowhere near as versed
in SQL as he and many of you are.)

Joe



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.