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!

How to use Table valued parameters for inline query using odp.net Oracle.ManagedDataAccess

a2a2863b-fc01-4efa-9040-4e08e566d1fcDec 12 2018 — edited Dec 12 2018

Hi,

I am trying to convert SQL queries to Oracle with ODP.NET ManagedDataAccess.

I have inline query with table valued parameter as below

select ts.code from tablets ts inner join table(:abccol) ac on ts.id = ac.Id

and I am preparing the table valued parameters as follows

public static SqlParameter ToTVPIdParams(this string[] Ids, string variableName)

        {

            DataTable dtIds = new DataTable();

            dtIds.Columns.Add(new DataColumn("Id", typeof(string)));

            foreach (string Id in Ids)

            {

                DataRow row = dtIds.NewRow();

                row["Id"] = Id;

                dtIds.Rows.Add(row);

            }

            return new SqlParameter() { ParameterName = variableName, SqlDbType = SqlDbType.Structured, TypeName = "IDTVP", Value = dtIds };

        }

I am trying to convert this to Oracle Db, But I can't see OracleDbTypes table, array.

Please help me.

Comments
Post Details
Added on Dec 12 2018
1 comment
678 views