This is DB2 on the IBM I.
I use Run SQL Scripts to test my SP.

I even tried to initialize the out parameter as follows and got the same result...
CALL SGDEDMGT.USPGETBLAHIDFROMBLAHNUM(
BLAHNO => 'xx#########00000####',
/* IN CHARACTER(20) */
BLAHID => '0' /* OUT INTEGER */
);
This is the result I get back...
[ 09/09/2022, 03:45:30 PM ] Run All...
CALL SGDEDMGT.USPGETBLAHIDFROMBLAHNUM( BLAHNO =>
'xx#########00000####', BLAHID => '0' )
Return Code = 0
Output Parameter #2 (BLAHID) = <NULL>
Statement ran successfully (141 ms)
I even tried the CALL with the simplest format, as follows and still receive the same result...
CALL SGDEDMGT.USPGETBLAHIDFROMBLAHNUM(
'xx#########00000####',?);
I just don't understand why I'm getting null for BLAHID.
Here is my stored proc.
CREATE PROCEDURE USPGETBLAHIDFROMBLAHNUM (
IN BLAHNO CHAR(20),
OUT BLAHID INTEGER
)
LANGUAGE SQL
P1 : BEGIN
DECLARE TMPP INTEGER;
SET TMPP = (
SELECT BLAHID
FROM SGDEDMGT.BLAHS
WHERE "BlahNumber" = BLAHNO ) ;
SET BLAHID = TMPP;
END P1
Btw, in case anyone is wondering, I sanity checked by doing a simple SELECT WHERE just to be sure the test data I'm filtering for is actually there as a returnable value :)