Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

specified cast is not valid error while pass an array from vb.net to pl/sql

317197Nov 5 2004 — edited Nov 8 2004
Hi,
i'm trying to pass a bind array to a pl/sql procedure from vb .NET, but i get the following error : "Specified cast is not valid"

here it is the pl/sql definition of the procedure :

PROCEDURE ControllaDati(strutt IN rc, id_client IN NUMBER, ret OUT NUMBER);

and the definition for the type rc :

type rc IS TABLE OF VARCHAR2(15) index by binary_integer;

Now the Vb code :

Dim cmd As Oracle.DataAccess.Client.OracleCommand
Dim sCmd As String, lRetVal As Long

sCmd = "BEGIN MODIFICA.controlladati(:ARR, :ID, :RET); END;"
cmd = New Oracle.DataAccess.Client.OracleCommand(sCmd, oraConnection)
cmd.CommandType = CommandType.Text
cmd.Parameters.Add("arr", OracleDbType.Varchar2, ParameterDirection.Input).Value = stru
cmd.Parameters.Add("id", 1).Direction = ParameterDirection.Input
cmd.Parameters.Add("ret", lRetVal).Direction = ParameterDirection.Output
cmd.ArrayBindCount = 10

Try
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try

i'm sure the connection works, because i use it for other pourpose.
The error appears when the 'cmd.ExecuteNonQuery' is called.
maybe there's something wrong with the array pass from vb .net trought pl/sql procedure ?!?!

thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2004
Added on Nov 5 2004
2 comments
1,353 views