waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

python calling db2 stored procedure and NOT getting output parameters #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create db2 SP, tested and it looks OK
2. called from python, but NO data in variable
3.

What is the expected output? What do you see instead?
I expect the python variable to contain data, but all data is blank

What version of the product are you using? On what operating system?
ubuntu linux,  

db2inst1@ubuntu:/home/db2inst1> db2level
DB21085I  Instance "db2inst1" uses "32" bits and DB2 code release "SQL09070" 
with level identifier "08010107".
Informational tokens are "DB2 v9.7.0.0", "s090521", "LINUXIA3297", and Fix Pack 
"0".
Product is installed at "/opt/ibm/db2/V9.7".

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Please provide any additional information below.

Original issue reported on code.google.com by askalien...@gmail.com on 27 Sep 2011 at 2:40

Attachments:

GoogleCodeExporter commented 9 years ago
http://sqlrelay.sourceforge.net/sqlrelay/programming/pythondb.html

DB2

In DB2, stored procedures return values through output parameters rather than 
as return values of the procedure itself. However, the SQL Relay Python DB 
driver does not currently support output parameters.

Original comment by askalien...@gmail.com on 27 Sep 2011 at 3:02

GoogleCodeExporter commented 9 years ago
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.
db2.luw.apdv.python.doc%2Fdoc%2Ft0054696.html

the db2 manual give instructions,  saying this works

Original comment by askalien...@gmail.com on 27 Sep 2011 at 3:03

GoogleCodeExporter commented 9 years ago
In ibm_db driver there is an API "callproc" to call stored procedure, This API 
is capable to return modified OUT parameters. 

You can find description about this API at 
http://code.google.com/p/ibm-db/wiki/APIs#ibm_db.callproc

please use this API and let me know how it goes.

Original comment by rahul.pr...@in.ibm.com on 27 Sep 2011 at 6:17

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 10 Oct 2011 at 8:03