Frankie Simon Frankie Simon - 1 month ago 9
C# Question

Is there a way to pass a custom type from C# to Oracle using System.Data.OracleClient?

I was searching online for a solution to passing a string array to a stored procedure in Oracle. The "easy" but messy way was using a comma delimited string.

I had found a sample based on which I created my own type of TABLE of VARCHAR2(200).

I understood that I could use a constructor created "behind-the-scenes" by Oracle to give a list of values that would, in the PL/SQL, be treated as a TABLE I could iterate through.

But when I got to the C# I saw that there is no way for me to create an OracleParameter object that would allow me to use this implicit constructor.

All the samples I'm finding online for now are dealing with Oracle Data Adapter, none say anything about System.Data.OracleClient.

Is there a way to achieve this?

Answer

Every resource I find sends me to ODP, and adds that I shouldn't bother with the Microsoft provider since it's going to be deprecated in .NET 4.

I think I'm giving up on this for now, thanks for the help Alex and Diadistis.