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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Passing a string array to an oracle stored procedure

811996Nov 10 2010 — edited Nov 12 2010
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2010
Added on Nov 10 2010
1 comment
2,137 views