There's numerous question and confusing docs on the subject, but no luck so far.
I've the following PL/SQL stored procedure;
PROCEDURE PS_test(
Liste1 Listcar,
Liste2 Listcar,
P_CURS_MESSAGE out CURSOR_REF_TYP
)
Where the type Listcar
is the following:
TYPE Listcar IS VARRAY(100) OF VARCHAR2(50);
Here is what I'm trying so far:
string[] list = { "name1", "name1" };
OracleParameter oParam = (OracleParameter)myOracleCommand.CreateParameter();
oParam.ParameterName = "Liste1";
oParam.UdtTypeName = "LISTCAR";
oParam.Value = list;
oParam.Direction = ParameterDirection.Input;
myOracleCommand.Parameters.Add(oParam);
With the following error on the Value assignment:
Value does not fall within the expected range.
Tried to use the type varchr2, to set the ArrayBindSize and so on, but no luck so far.
I guess the interface IOracleArrayTypeFactory
might play a role somewhere, but how?
I haven't used the udtType feature in ODP.NET, so I am not sure how to achieve your goal with this. However, to pass an array of string you don't need it.
Like the documentation you attached, you need to create a package contains your stored procedure, and takes an associative array (not VARRAY) as input parameter.
For example:
Now, run this code, put your own connection string.