Send array to oracle stored procedure with ODP.NET (Very Urgent)

S

sonukapoor

Hey

I am trying to send an array to an oracle stored procedure to do a
select. My select would do something like this:


Select somefield from sometable where someotherfield in (array)

I have tried this code, but it always returns me the error:

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

Dim Comm As New OracleCommand("Array_Test", conn)
Comm.CommandType = CommandType.StoredProcedure

Comm.Parameters.Add("p_array", OracleDbType.Int32)
Comm.Parameters("p_array").Direction = ParameterDirection.Input
'Comm.Parameters("p_array").CollectionType =
OracleCollectionType.PLSQLAssociativeArray
Comm.Parameters("p_array").Value = New Int32() {1, 2, 3}
Comm.Parameters("p_array").Size = 3
Comm.ArrayBindCount = 3

Comm.Parameters.Add("thecur", OracleDbType.RefCursor)
Comm.Parameters("thecur").Direction = ParameterDirection.Output

Dim ds As New DataSet
Dim adp As New OracleDataAdapter(Comm)
adp.Fill(ds) <-- error occurs here.

I would appricate any help or suggestions.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top