Hmmmmmmm should work in this way.
What exactly is the SQLCODE or SQLSTATE after the CALL?
Are all PTFs installed?
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 losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Matt
Olson via MIDRANGE-L
Sent: Donnerstag, 26. Dezember 2019 18:04
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Matt Olson <Matt.Olson@xxxxxxxx>
Subject: Calling a stored procedure from RPG
Does anyone know how to call a SQL Stored procedure from RPG and pass in
integer and receive the response back in the output variable?
We are having an issue where the input parameter doesn't appear to be mapped
to the input parameter (RTID), and the CREDSTRING output variable is always
blank.
We are able to successfully call the procedure using straight SQL. It just
doesn't work from RPG.
Here is the SQL Stored procedure def:
CREATE PROCEDURE TESTLIB.GETCREDSTRING (
IN RTID INTEGER ,
OUT CREDSTRING VARCHAR(50) )
LANGUAGE SQL
SPECIFIC TESTLIB.GETCRDSP
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
SET OPTION ALWBLK = *ALLREAD ,
ALWCPYDTA = *OPTIMIZE ,
COMMIT = *NONE ,
DECRESULT = (31, 31, 00) ,
DFTRDBCOL = TESTLIB,
DYNDFTCOL = *NO ,
DYNUSRPRF = *USER ,
SRTSEQ = *HEX
BEGIN
....
...
END ;
One input parameter RTID (integer), and one output parameter (credstring)
Our RPG program is as follows:
CTL-OPT DATFMT(*USA) DEBUG(*YES) DFTACTGRP(*NO) ALWNULL(*USRCTL);
DCL-S InParm int(10);
DCL-S OutParm VARCHAR(50);
InParm = 0000600002;
EXEC SQL
call getcrdsp (:Inparm, :Outparm);
*INLR = *ON;
Return;
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.