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





I had an RPGLE procedure with a prototype of:

D UcFirst pr 512 varying
D pString 512 value varying

I tried to define a SQL Procedure as such:

CREATE FUNCTION UCFIRST (
INSTR VARCHAR(512))
RETURNS VARCHAR(512)
LANGUAGE RPGLE
PARAMETER STYLE GENERAL...

I could call the procedure but it crashed with an 'index out of bounds'
error. When I debugged, I saw garbage in the parameter. So, I changed the
prototype/interface to:

D UcFirst pr 512 varying
D pString 512 const varying

Note the keyword CONST instead of VALUE. Everything worked.

Can you not call RPGLE procedures from SQL if the procedure expects values
passed by value? Just wondering if there is another way to solve this
without always changing the procedure definition. Also, is there a
document that discusses passing of parameters between RPG and SQL, because
I cannot find one. I am sure I am just missing it.

Matt

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.