I am attempting to update an Oracle VARRAY type column from c#

12 hours ago 2
ARTICLE AD BOX

I am trying to update a VARRAY column in an Oracle Table using Oracle.ManagedDataAccess.Client in C#

I have the following code:

OracleCommand cmd2 = new OracleCommand( "update mytable set hcodes = :hcodes where ich = 'xxx'", ora); cmd2.Parameters.Add(new OracleParameter{ParameterName = ":hcodes",UdtTypeName = "HCODE_ARRAY"}); cmd2.Prepare(); cmd2.Parameters[":hcodes"].Value = new string[] { "ABCD", "DEFG" }; cmd2.ExecuteNonQuery();

When I execute this code I get:

Oracle.ManagedDataAccess.Client.OracleException: 'ORA-00932: inconsistent datatypes: expected HCODE_ARRAY got CHAR'

HCODE_ARRAY is defined as:

CREATE OR REPLACE TYPE HCODE_ARRAY AS VARRAY(5) of varchar2(4); /
Read Entire Article