Passing arrays to oracle stored procedure
Posted: Thu 04 Oct 2012 21:30
Hello,
I am trying to pass a list of Guids from .Net to a stored procedure in Oracle.
In oracle, I have this:
In .Net, I am trying to do this:
Yet I always receive an error in converting the type from guid[] to t_guid, or a "index out of bounds" when converting. Please advise on how to pass an array of guids to a stored procedure.
Thanks.
Info:
Version Devart.Data.Oracle v7.1.58.0
Oracle 11.2
I am trying to pass a list of Guids from .Net to a stored procedure in Oracle.
In oracle, I have this:
Code: Select all
CREATE OR REPLACE TYPE t_guids AS TABLE OF RAW(16);
Code: Select all
var ids1 = new Devart.Data.Oracle.OracleParameter()
{
ParameterName = "p_ID1",
OracleDbType = OracleDbType.Table,
OracleValue = new Guid[] { Guid.NewGuid() },
Direction = ParameterDirection.Input,
ObjectTypeName = "t_guids"
};
var ids2 = new Devart.Data.Oracle.OracleParameter()
{
ParameterName = "p_ID2",
OracleDbType = OracleDbType.Table,
OracleValue = new Guid[] { Guid.NewGuid() },
Direction = ParameterDirection.Input,
ObjectTypeName = "t_guids"
};
context.ExecuteStoreCommand("begin CONST2.setarray(:p_ID1, :p_ID2); end;",
ids1,
ids2);
Thanks.
Info:
Version Devart.Data.Oracle v7.1.58.0
Oracle 11.2