I'm a little confused. I'm not sure where to post this question....
Trying to write a SQL stored procedure RPGLE program that accepts one null capable parameter.
I got a couple questions regarding the RPG program.....
Prototype...
Program interface...
Reference to null field...
From what I understand this should work.
However, it doesn't. When I put the program in debug within RDI the program starts debug and displays the variable value in the monitor, but when I press F5 to enter the first line of code it goes away and debug says the pointer is not set. The program fails later on with a MCH3601 at the %nullind() statement. The occurs if I use nulls from run SQL scripts or if I actually send a value.
Here is the SQL create statement....
If I don't try to use null logic and remove the nullind stuff the program will work with blanks just fine. I rather use nulls though.
One other weird thing I noticed. If I reference the %parms() function it returns 2...shouldn't it always be 1???
Thanks for your help...
Trying to write a SQL stored procedure RPGLE program that accepts one null capable parameter.
I got a couple questions regarding the RPG program.....
Code:
Ctl-Opt DftActGrp(*No) ALWNULL(*USRCTL);
Code:
dcl-pr PROCEDURE_PROFILES extpgm('LP9904I1'); pProfileName char(40) options(*nopass: *nullind); end-pr;
Code:
dcl-pi PROCEDURE_PROFILES; pProfileName char(40) options(*nopass: *nullind); end-pi;
Code:
if %nullind(pProfileName) = *off;
However, it doesn't. When I put the program in debug within RDI the program starts debug and displays the variable value in the monitor, but when I press F5 to enter the first line of code it goes away and debug says the pointer is not set. The program fails later on with a MCH3601 at the %nullind() statement. The occurs if I use nulls from run SQL scripts or if I actually send a value.
Here is the SQL create statement....
Code:
CREATE PROCEDURE &LIB/ PROCEDURE_PROFILES ( IN P_PROFILE CHAR(40) ) DYNAMIC RESULT SETS 1 LANGUAGE RPGLE SPECIFIC PROCEDURE_PROFILES NOT DETERMINISTIC READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'LPCAPPDEV/LP9904I1' PARAMETER STYLE GENERAL WITH NULLS ; COMMENT ON SPECIFIC PROCEDURE PROCEDURE_PROFILES IS 'MTech List of Profiles' ;
One other weird thing I noticed. If I reference the %parms() function it returns 2...shouldn't it always be 1???
Thanks for your help...
Comment