使用 zxJDBC 调用过程时参数的数量或类型错误

Wrong number or types of arguments in call to procedure with use zxJDBC

我从http://www.jython.org/archive/21/docs/zxjdbc.html拿了官方例子:

Oracle
>>> c = db.cursor() # open the database as in the examples above
>>> c.execute("create or replace function funcout (y out varchar2) return varchar2 is begin y := 'tested'; return 'returned'; end;")
>>> params = [None]
>>> c.callproc("funcout", params)
>>> print params

当我 运行 此代码时出现异常:

PLS-00306: wrong number or types of arguments in call to 'FUNCOUT' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

如何解决?

补充!!!此代码也不起作用:

  outParam = ""
            self.cursor.execute("create or replace function funcout (y out varchar2) return varchar2 is begin y := 'tested'; return 'returned'; end;")
            self.cursor.callproc("funcout", [outParam])

当你有一个 OUT 或 IN OUT 参数时,你必须传递一个变量,而不是该参数的文字。该过程还可以如何将值传回?

你可以看看PLSQLSample.java