Stefaan Van Hoof
Stefaan Van Hoof

Reputation: 85

Inserting an OracleClob array

For my .NET project i really need to be able to insert an array of Clob's into an Oracle Db, using the Oracle.ManagedDataAccess lib.

byte[] newval = System.Text.Encoding.Unicode.GetBytes("Testyy");
                    var clob = new OracleClob(connection);
                    var clobList = new List<OracleClob>() { clob, clob };
                    clob.Write(newval, 0, newval.Length);

                    var longText = new OracleParameter
                    {
                        ParameterName = "p_tc_long_text",
                        OracleDbType = OracleDbType.Clob,
                        CollectionType = OracleCollectionType.PLSQLAssociativeArray,
                        Value = clobList.ToArray(),
                        Size = clobList.Count,
                    };

                    command.Parameters.Add(longText);

After execution of the command i get the Oracle Error:

ORA-03120: two-task conversion routine: integer overflow.

Upvotes: 2

Views: 860

Answers (2)

Andr&#233; Fonseca
Andr&#233; Fonseca

Reputation: 1

Change the OracleDbType.Clob to OracleDbType.NClob. Its work to me!

Upvotes: 0

Stefaan Van Hoof
Stefaan Van Hoof

Reputation: 85

It's not supported

ODP.NET supports binding parameters of PL/SQL Associative Arrays which contain the following data types.

  • BINARY_FLOAT
  • CHAR
  • DATE
  • NCHAR
  • NUMBER
  • NVARCHAR2
  • RAW
  • ROWID
  • UROWID
  • VARCHAR2

Upvotes: 0

Related Questions