baztian / jaydebeapi

JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
GNU Lesser General Public License v3.0
365 stars 148 forks source link

Call Procedure with output parameters on JDBC IBM DB2 #205

Closed DeltaFox0018 closed 1 year ago

DeltaFox0018 commented 2 years ago

Hello, I am using jaydebeapi via python I created a procedure on AS400 with 2 input parameters and 1 output

CREATE PROCEDURE Procedure (
IN user CHAR(10),
IN psw CHAR(10) ,
OUT error CHAR(1))
LANGUAGE RPGLE
SPECIFIC JRAPOBJ.JRI01SV1SP
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME 'LIB/PROGRAM'
PARAMETER STYLE GENERAL WITH NULLS

from SQL if I run the call CALL Procedure(user, psw, ?) I return as a result the variable error with S or N based on whether the login is successful or not Via in JDBC driver if I call with cursor.execute() works but I can’t recover the output data

If I make a cursor print.arraysize I return 1 instead cursor.rowcount I return 0

How do I do that? Thank you

9icon commented 2 years ago

Was looking for how to retrieve output parameters as well. Is this option now available?