Passing a string array to an oracle stored procedure
811996Nov 10 2010 — edited Nov 12 2010I am new to oracle and I have written a stored procedure which accepts a string array as a parameter.
create or replace PROCEDURE DELETEINVALIDEMAILS
+(searchList IN OUT NOCOPY TStrings ) AS+
BEGIN
forall i in 1..searchList.Count
delete from job_searches where seeker_id = searchList(i);
END;
TStrings is declared as a type:
create or replace type TStrings as table of varchar2(32767);
Now how do I invoke this from .Net? I have searched the forum extensively and I can't seem to find an answer. I have given a few lines of my C# code.
+string[] seekrID = { "KY001049286" };+
cmd = new OracleCommand("DELETEINVALIDEMAILS", con);
OracleParameter test = new OracleParameter("searchList", OracleDbType.Varchar2);
cmd.Parameters.Add(test);
test.Direction = ParameterDirection.Input;
con.Open();
cmd.CommandType = CommandType.StoredProcedure;
test.Value = seekrID;
var result = cmd.ExecuteReader();
The error message I get is- wrong number or types of arguments in call to 'DELETEINVALIDEMAILS
Thanks in advance.
Edited by: 808993 on Nov 10, 2010 12:44 PM