I'm running a java program on a PC which calls z/OS SQL stored
procedure. The stored procedure returns an integer which should
contain "2", but is always "0".
I (pre)compile the stored procedure from the PC using "IBM Data
Studio" which automatially refreshes the WLM proc.
Is there something simple I'm missing? Do I need to stop/start the
DB2 procedure?
Thank you in advance,
Serenity
Background -
Running UDB V9.5 on PC
Running DB2 v8.1 on z/OS 1.5
Java snippet -
cstmt = con.prepareCall ("CALL SCRATCHDB.SAMPL EPROCEDURE(?)") ;
cstmt.registerO utParameter(1, Types.INTEGER);
cstmt.execute() ;
int AwCrap = cstmt.getInt(1) ;
System.out.prin tln("SAMPPROC output - " + AwCrap);
Stored procedure -
CREATE PROCEDURE SAMPLEPROCEDURE
(OUT RETURN_THIS_DAM NIT INTEGER )
RESULT SETS 1
LANGUAGE SQL
EXTERNAL NAME SAMPPROC
FENCED
COLLID SCRATCHDB
WLM ENVIRONMENT WLMENV1
RUN OPTIONS 'NOTEST(NONE,*, *,*)'
BEGIN
DECLARE RETURN_THIS_DAM NIT INTEGER DEFAULT 1;
SET RETURN_THIS_DAM NIT = 2;
END
Running hte java program displays -
SAMPPROC output - 0
procedure. The stored procedure returns an integer which should
contain "2", but is always "0".
I (pre)compile the stored procedure from the PC using "IBM Data
Studio" which automatially refreshes the WLM proc.
Is there something simple I'm missing? Do I need to stop/start the
DB2 procedure?
Thank you in advance,
Serenity
Background -
Running UDB V9.5 on PC
Running DB2 v8.1 on z/OS 1.5
Java snippet -
cstmt = con.prepareCall ("CALL SCRATCHDB.SAMPL EPROCEDURE(?)") ;
cstmt.registerO utParameter(1, Types.INTEGER);
cstmt.execute() ;
int AwCrap = cstmt.getInt(1) ;
System.out.prin tln("SAMPPROC output - " + AwCrap);
Stored procedure -
CREATE PROCEDURE SAMPLEPROCEDURE
(OUT RETURN_THIS_DAM NIT INTEGER )
RESULT SETS 1
LANGUAGE SQL
EXTERNAL NAME SAMPPROC
FENCED
COLLID SCRATCHDB
WLM ENVIRONMENT WLMENV1
RUN OPTIONS 'NOTEST(NONE,*, *,*)'
BEGIN
DECLARE RETURN_THIS_DAM NIT INTEGER DEFAULT 1;
SET RETURN_THIS_DAM NIT = 2;
END
Running hte java program displays -
SAMPPROC output - 0
Comment