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



All:

I am trying to use SQL CLI api's inside RPGLE to call stored procedure
using parameter markers. Below is a code sample.
My stored proc has three parms - the first two are inputs and the last is
an output. If I do not specify an out parm in the stored procedure and
only do parameter binding for input vars - the parms are passed to the rpg
called by the stored proc fine.

However - If I specific an out parm and bind that outparm - the input
parms in my rpg stored proc are truncated to the first char of each parm.
Example - If in@parm1 = 'ABCDEF' and in@parm2 = 'XYZABC' - when called
without specifying or binding an out parm - the values are passed
correctly.
IF I specific and bind the outparm - then in@parm1 gets passed as 'A' and
in@parm2 gets passed as 'X'.
Any suggestions are most welcome.

w@call = 'Call Sample_Stored_Procedure3(?,?,?)';

SQLPrepare(stmt :w@call : %size(w@call));

SQLBindParameter(stmt
:1
:SQL_PARAM_INPUT
:SQL_CHAR
:SQL_CHAR
:10
:0
:%addr(in@parm1)
:10
:10);

SQLBindParameter(stmt
:2
:SQL_PARAM_INPUT
:SQL_CHAR
:SQL_CHAR
:10
:0
:%addr(in@parm2)
:10
:10);

SQLBindParameter(stmt
:3
:SQL_PARAM_OUTPUT
:SQL_CHAR
:SQL_CHAR
:1
:0
:%addr(out@parm1)
:1
:SQL_NULL_DATA);

SQLExecDirect( stmt
: w@call
: SQL_NTS );

Terry Bullard â Applications Programmer Analyst

Phone (910) 630-5644 / (GTN) 571-5644
Email: Terry_Bullard@xxxxxxxxxxxx

"Contains Confidential and/or Proprietary Information.
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company."

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.