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


  • Subject: Re: Can we retrieve stored procedure return result sets with RPG IV?
  • From: afvaiv <afvaiv@xxxxxxxxxx>
  • Date: Wed, 23 May 2001 15:19:07 +0200

Tom,
I had the same problem some time ago, asked about the same question and someone
(?, don't recall his name) pointed out that it could only be done using CLI
programming, and could be found in the book "Who Knew You Could Do That with RPG
IV? A Sorcerer’s Guide to System Access and More", SG24-5402-00, which I guess
you already know of. I don't know if it will be available in future releases for
nomal RPG IV, but as of today CLI seems to be the only way to do it.

Following the code in mentioned redbook, its library "RPGISCOOL" brings some
code.

Taking this as a starting point, and "with quite a lot of work and effort..." (I
had never programmed RPG the CLI way of doing things...) I was finally able to
develop a set of two (independent) sample programs working in RPG to do things
"the CLI way",  the first one to "exec" SQL sentences from within the RPG (the
CLI way ...) , the second to acheive the final goal: receiving in RPG a result
set from a stored procedure. (BTW, in AS/400 just one (and only one...) result
set can be returned as a result by a stored procedure...)

The reason I needed to do the last, receiving the result set, is that sometimes
we had problems debugging a VBasic or Delphi ADO/OLEDB program, and I wanted to
be able to "evoke and receive same results" natively (in RPG, which for me is
much easier to debug...) as the VB or Delphi program would, just to make sure 
the
AS/400 "server part" of the application was working as expected...

Hope this helps. If you need additional info, e-mail me privately if you want.
Best regards.
=========================================================
"Westdorp, Tom" wrote:

> Is it possible to retrieve stored procedure result set(s) using RPGIV?  If
> so, can someone point me to the manual or an example?
>
> The 'DB2 UDB for AS/400 Advanced Database Function' Redbook (SG24-4249-02)
> for v4r5 says (in a note on Page 270) that "Some traditional programming
> languages, such as RPG and COBOL, are not able to retrieve stored procedure
> return result sets."  Is that still true for v5r1?
>
> I created a test db, added a stored procedure to create a result set and can
> see it in Ops Nav, but now how do I get it into my program? Currently it's
> all on the iSeries but when in production the database in question will be
> on a win2k box running SQL 7.0.
>
> I'm trying to get a small database replicated from the mickey mouse 2k box
> of the vendor to the business systems on the iSeries.
>
> Thanks!
>
> Tom Westdorp
> AS/400 Senior Programmer/Analyst
> IBM Certified Specialist - RPG IV Programmer
> IBM Certified Specialist - RPG IV Developer
> Certified Master RPG IV Programmer
> Voice: (702) 221-6859
> Fax:    (702) 221-6881
> tom.westdorp@stationcasinos.com <mailto:tom.westdorp@stationcasinos.com>
>
> ==> The trouble with hitting the jackpot on a slot machine is that it takes
> so long to put the money back.
>
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---

--
-----------------
Antonio Fernandez-Vicenti
afvaiv@wanadoo.es


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.