I'm trying to pass an array to a stored procedure using almost the same method described here: http://www.devart.com/dotconnect/oracle ... Table.html
My stored procedure is:
Where NUM_ARR is a table of NUMBER.create or replace procedure ARRAY_TEST_PROC
(
arr_in IN NUM_ARR,
response OUT NUMBER
)
AS
BEGIN
response := arr_in(1)+arr_in(2);
END;
And I try to call it with:
But I got:OracleConnection conn = ((EntityConnection)ctx.Connection).StoreConnection as OracleConnection;
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "ARRAY_TEST_PROC";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("arr_in", OracleDbType.Number);
cmd.Parameters.Add("response", OracleDbType.Number, System.Data.ParameterDirection.Output);
cmd.Parameters["arr_in"].ArrayLength = 2;
cmd.Parameters["arr_in"].Value = new decimal[] { 1, 2 };
cmd.ExecuteNonQuery();
conn.Close();
What am I doing wrong?ORA-06550: line 2, column 3:
PLS-00306: wrong number or types of arguments in call to 'ARRAY_TEST_PROC'
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
Thanks,
Zoltan Tanczos