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



Thank you for sharing this. I didn't realize it was as easy as calling the
Retrieve Message API. After looking through it, I condensed my version a bit
and allowed for a call when SQLCOD = 0. I also wrapped it in a subprocedure,
which I will post to my website in a day or so.

Thanks,
Loyd

-----Original Message-----
From: Pete Hall [mailto:pbhall@ameritech.net]
Sent: Thursday, April 11, 2002 4:56 PM
To: midrange-l@midrange.com
Subject: Re: Retrieve SQLCODE descriptions programmatically?

--
At 09:28 04/11/2002, Loyd Goodbar wrote:
>Does anyone have a piece of code they would be willing to share?
>
>Ideally, I'm looking for a subprocedure (called from RPG/IV) that will
>accept a SQLCODE and SQLERRM, and return the explanation text from the SQL
>message file QSYS/QSQLMSG. Substitution variables would be replaced with
>values in SQLERRM.


Loyd,

This should get you started. When SQLCOD <> SQL_OK, you execute the
RtnSqlMsg routine. The message ends up in the DataSpace variable. The code
is so minimal, I've never made it into a service procedure, but you could
certainly do that.

<lots of code snipped>


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.