odbc: how to call a stored function in Oracle

Tom Hines tom.hines at usa.net
Wed Nov 7 15:16:42 EST 2001


Hi.  I'm using ActivePython 2.1.212 and MS ODBC driver for Oracle.  I
am able to call a stored procedure that returns a cursor, but I
haven't been able to figure out how to call a stored function or a
procedure that has an output parameter.

# this works
schools = ""
ret = cur.execute(
    "{Call MYPKG.MYPROC (?, {resultset 50, outSchools})}",
    ('myparam', schools))


# this doesn't work
retparam = 0
ret = cur.execute("{? = Call MYPKG.MYFUNC (?)}",
    (retparam, 5341562))

I've tried a million combinations trying to get it to work, but I
either get

dbi.internal-error: [Microsoft][ODBC driver for Oracle]Invalid
parameter type in EXEC

or

dbi.program-error: [Microsoft][ODBC driver for
Oracle][Oracle]ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'MYFUNC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored in EXEC

Anybody know how to do this?

--
Tom Hines



More information about the Python-list mailing list