<How do I call it ?>
CALL
gnodgdf/GetShortSKU(?,CHAR('ABC'),CHAR('SoldToABC'),CHAR('TypeOfItem'));
NOTES:
- if using SQL naming syntax, I don't think you can qualify the SP call, but
you can set the SQL PATH variable to include the libraries that house your
SPs & UDFs
- iNav's Run SQL Scripts is a very nice tool for testing SP calls
- Since this SP doesn't return a result set, you should be able to call it
in RPG. If it was returning the result set you'd have to use CLI in RPG.
- since you only return one variable, another option is a UDF instead of SP.
Then you can call it in RPG using something like:
exec sql VALUES(CHAR('ABC'),CHAR('SoldToABC'),CHAR('TypeOfItem')) INTO
:myHostVariable;
Elvis
RPG & DB2 Summit | Minneapolis | October 1-4
Mike Cain - DB2 for i5/OS Temporary Indexes - The Good, The Bad, The Ugly
October 16
2007 System i Fall Technical Conference | Orlando | November 4-7
Celebrating 10-Years of SQL Performance Excellence on IBM System i, eServer
iSeries and the server affectionately known as the AS/400
-----Original Message-----
Subject: Syntax for calling stored procedure
I created a stored procedure from STRSQL like so:
CREATE PROCEDURE gnodgdf/getShortSKU(
OUT ShortSKU CHAR(7),
IN Company CHAR(3),
IN SoldTo CHAR(9),
IN Item CHAR(12))
LANGUAGE RPGLE
SPECIFIC GNODGDF/ORDERAPI_getShortSKU
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME 'GNODGDF/SORDERAPI(ORDERAPI_GetShortSKU)'
PARAMETER STYLE GENERAL
I got the message indicating that it was successfully created.
Now the question. How do I call it ? Can I test this interactively
from STRSQL or Iseries Navigator RUNSQL Scripts ?
What's the correct syntax ?
If not, what's the correct syntax using EXEC SQL in RPG (/Free) ?
Thanks
Greg Fleming
As an Amazon Associate we earn from qualifying purchases.
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.