[cx-oracle-users] Can't figure out how to use Cursor.arrayvar
Brought to you by:
atuining
|
From: L. D. B. <dan...@gp...> - 2005-06-24 21:13:38
|
Can someone please explain how to work with arrays? Specifically,
how do I pass an array into a stored procedure/stored function, and
how do I retrieve an array from a stored procedure/stored function?
Example:
create or replace type foo is varray(20) of varchar2(30);
create or replace function getFoo return foo
IS
l_data foo := foo();
BEGIN
l_data.EXTEND;
l_data(1) := 'Some text';
return l_data;
END getFoo;
c = cx_Oracle.connect('foo/bar@baz')
cursor = c.cursor()
cursor.callfunc('getFoo', [cx_Oracle.STRING, 20])
Traceback (most recent call last):
File "<stdin>", line 1, in ?
cx_Oracle.DatabaseError: ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
If the stored function returns STRING, or NUMBER, everything is fine,
but I need to make this work with arrays.
Thanks much for your help,
L. Daniel Burr
|