× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

I have a problem when calling sqlrpgle program with parameters from python
ibm_db_dbi as database driver.

*Python program:*





*from bottle import Bottle, route, run, template, request, BaseTemplate,
static_file, postfrom string import capwordsimport ibm_db_dbi as dbiconn =
dbi.connect(dsn=None, database='*LOCAL', user=None, password=None)cur =
conn.cursor()app = Bottle()*

*#Call rpg program works fine with no parameters*
*@app.route('/resttest1')*





*def resttest1(): cur.callproc('nicd_99.resttest1 , ()) headers=[]
for descr in cur.description: headers.append(descr[0]) return
template('root', rows=cur, headers=headers)*

* #Error when calling rpg with parameters*
*@app.route('/resttest2')*






*def resttest2(): cur.callproc('nicd_99.resttest2 , ('test1' ,
'test2')) headers=[] for descr in cur.description:
headers.append(descr[0]) return template('root', rows=cur,
headers=headers)*

*run(app, host = '0.0.0.0', port=10022, reloader=True)*

*Error when running RESTTEST2 wih parameters:*

Traceback (most recent call last):

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db_dbi.py",
line 1197, in _callproc_helper
result = ibm_db.callproc(self.conn_handler, procname,parameters)

result = ibm_db.callproc(self.conn_handler, procname,parameters)

Exception: RESTTEST2 in NICD_99 type *N not found. SQLSTATE=42704
SQLCODE=-204
During handling of the above exception, another exception occurred:
Traceback (most recent call last):


File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/bottle-0.12.8-py3.4.egg/bottle.py",
line 862, in _handle
return route.call(**args)

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/bottle-0.12.8-py3.4.egg/bottle.py",
line 1732, in wrapper
rv = callback(*a, **ka)

File "vis_tfftestdata.py", line 36, in resttest2

cur.callproc(pgmName2 , pgmParamValues2)

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db_dbi.py",
line 1224, in callproc
result = self._callproc_helper(procname, parameters)
File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db_dbi.py",
line 1200, in _callproc_helper
raise self.messages[-1]

I'm running python 3.6 - but see that the error message is pointing to
python3.4.
Any idea on how to fix this?

Beste regards
Magne

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.