I've created this RPGLE procedure/service program that is suppose to return
the calling program. When I call the procedure directly through RPGLE, I
get the name of the program that I'm expecting. However, when I call it
through SQL, I get "
LE_Create_Threa " as the response.
I've put a dump(a) right before the return statement and for some reason,
I'm getting two dumps when issuing through SQL. I'm not sure why.
When you look at the first dump created RTNVALUE = 'WZWW01R MSCHUTTE
WZWW01R QTEMP QILE WZWW01R '
But then there is a second dump. At the end of that dump it says...
"Variable data is not available in a secondary thread".
To test this I've created this simple program.
/define enviro_odw
/COPY QCPYSRC,HSPECS
/COPY QCPYSRC,RTVCALLERC
D rpgcall S 65
D sqlcall S 65
/Free
clear rpgcall;
rpgcall = RetrieveCaller();
clear sqlcall;
Exec SQL
Set :sqlcall = RetrieveCaller();
dump(A);
*InLR = *On;
Return;
/End-Free
This is my create function statement.
CREATE FUNCTION MSCHUTTE/RETRIEVECALLER ()
RETURNS CHAR(65)
LANGUAGE RPGLE
SPECIFIC RTVCALLER
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME RTVCALLER(RETRIEVECALLER)
PARAMETER STYLE GENERAL ;
I'm using this code
http://archive.midrange.com/rpg400-l/200209/msg00511.html in
RTVCALLER(RETRIEVECALLER) procedure.
In case you were wondering the value of RPGCALL was "'WZWW01R MSCHUTTE
WZWW01R QTEMP QILE WZWW01R " and SQLCALL was "
LE_Create_Threa"
I've done this before with other sql functions calling external programs.
But I do not get why it appears that the service program is getting called
twice. I believe that this is my issue. Anyone else experience this
before?
As an Amazon Associate we earn from qualifying purchases.