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



Hi,

1. you have to define your last 4 parameters in your RPG procedure with
Options(*Omit: *NoPass), Options(*NoPass) is not sufficient.
2. in your RPG procedure you have to check the parameters if not passed
%Parms or passed with *Omit, that means %Addr(Parm) = *NULL.
If a parameter is not passed the Stored Procedure will pass a
NULL-Pointer. If called as stored procedure %Parms is always -1.
3. Register the same procedure, with the same name 5 times with each
possible number of parameters.
The procedure gets overloaded, that means depending on the number of
parameters the right procedure gets called.
In this way you can call a stored procedure with "optional" parameters.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and loosing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Michael_Schutte@xxxxxxxxxxxx
Gesendet: Thursday, 11. September 2008 16:37
An: RPG programming on the AS400 / iSeries
Betreff: SQL procedure calling RPG procedure with optional *NOPASS parms



I have an existing service program that contains a procedure where the last
four parms are optional *NOPASS.

I know how to create the SQL wrapper to call the procedure but I was
wondering if there was a way to make the last four parms optional in the
sql procedure and only pass them to the RPG when the SQL receives them. Or
should I just go ahead and pass all fields and not worry about the *NOPASS.




Michael Schutte
Admin Professional
Try all four Knife & Fork Sandwiches, starting at 5.99.
For more information, visit www.NoOrdinarySandwich.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.