12

I need to pass an array from C#.net application to oracle stored procedure. Can anyone please let me know how to go about it? Also, which OracleType type do I use in C# when passing input parameter to stored procedure?

FYI, am using System.Data.OracleClient in my C# app.

Thanks.

2 Answers 2

8

Jimmy, the System.Data.OracleClient does not support arrays.
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/57a59fba-09e2-46cb-a072-6706b3ec5131

Depending on your need, you will either need to implement this via nested table types (via UDTs or assoc. arrays) using the ODP.net clients. This is probably a good direction to go, esp. since .net 4.0 has deprecated System.Data.OracleClient.

But if you are stuck with the System.Data.OracleClient and you are really just trying to do a variable in-list, you can do this by passing in a string and following some of these suggestions: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425

hope this helps

Sign up to request clarification or add additional context in comments.

Comments

2

You should use DB-defined nested table types to pass an array to PL/SQL. Take a look at this nice tutorial, it might help you.

3 Comments

Hi, thanks for your answer, but this approach requires Oracle .NET driver Oracle.DataAccess whereas I'm using Microsoft System.Data.OracleClient.
@Jimmy Hello. I'm beg my pardon, I was inattentive. Must admit that I don't know how to solve your issue with System.Data.OracleClient :)
It'd be best to switch to the Oracle drivers. More features, and they'll be supported out in to the future. Here's another example of a procedure that accepts an array. link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.