Running an AS/400 CL program via ODBC

Aaron Fransen aaronf at nospam.telusplanet.net
Tue Jun 5 00:54:56 EDT 2001


I have a problem executing an AS/400 CL program from the SQL/ODBC interface
in Python. I know the interface on the AS/400 works because I actually wrote
the code to do it originally in VB, which has been live on our web site for
months. I'm getting sick of the Really Big Visual Basic Corporation though,
and am in the process of converting the site to Python, which seemed to me
to be about the best/easiest/really cool tools out there.

I can run any SQL query via the ODBC 2 interface (Python 2.1) using the
following code:

dbc=odbc.odbc("datasourcename/as400username/password")
cursor=dbc.cursor()
cursor.execute("Select * from MYTABLE")
result=cursor.fetchall()

Works perfectly. However, if I try something like this:

cursor.execute("{{Call
LIB.PROGNAME(?,?,?,?,?,?)}}",['PARM1','TWO','THREE','1','',''])

it bakes with "SQL0204 - PROGNAME in LIB type *N not found. in EXEC".

Thoughts?





More information about the Python-list mailing list