All,

I have a conundrum that I can't decipher. I have a program that
contains optional parameters.

d*----------------------------------------------------------------------
--*
d* entry routine
d*----------------------------------------------------------------------
--*
d entry pi
d reqRefID$ 13a varying
d transID$ 13a options(*nopass) const varying
d begDate$ d options(*nopass) const
d endDate$ d options(*nopass) const

reqRefID$ is a return (output) variable in these calls.

If I make the calls from an RPG program, all is well. However, I have
three (3) variations of the call from SQL stored procedures, and only
one is working as expected.

Here are the procedures:

This one works as expected...
CREATE PROCEDURE MYLIB/MYPROCA (
OUT referenceID varchar(13),
IN orderID varchar(13))
EXTERNAL NAME MYLIB/MYPROC LANGUAGE RPGLE

This one returns the OUT variable, but does not produce any records...
CREATE PROCEDURE MYLIB/MYPROCB (
OUT referenceID varchar(13),
IN orderID varchar(13),
IN begDate date,
IN endDate date)
EXTERNAL NAME MYLIB/MYPROC LANGUAGE RPGLE

This one returns the OUT variable, but does not produce any records...
CREATE PROCEDURE MYLIB/MYPROCC (
OUT referenceID varchar(13))
EXTERNAL NAME MYLIB/MYPROC LANGUAGE RPGLE

This is the input logic:
/free
// get a unique key for the request
#get_unique('MYFIELD':k_field$:e_stat$:k_count$);
// if key returned, process request
if e_stat$ = 0;
// set return value
reqRefIDD$ = k_field$;
reqRefID$ = %char(%int(k_field$));
if %parms >= 2;
// select query type
monitor;
transIDD$ = %dec(transID$:13:0);
on-error;
transIDD$ = 0;
endmon;
if %parms >= 2 and transIDD$ > 0;
// get by trans id
exsr getTransID;
elseif %parms = 4 and begDate$ <= endDate$;
// get by date range
exsr getTransIDs;
endif;
else; // no optinal parms passed
exsr loopqueue;
endif;
endif;
// return unique key
*inlr = *on;
/end-free

These stored procedures are being called from ColdFusion on a remote
server.

Is there any way that I can invoke debugging during the remote call to
see what the program is receiving as input?

Thanks,
Tom Armbruster

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