using clob as an associative array in a stored procedure

Postby Paul » Mon 29 May 2006 09:19

You can use String type of array of char as a value for OracleDbType.Clob parameter. For more information please read "Working with BLOB and CLOB Data" article of OraDirect .NET help documentation.
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Postby Paul » Mon 29 May 2006 12:15

String type or array of char
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Postby Paul » Mon 29 May 2006 13:37

OraDirect .NET can work with DML array parameters of CLOB type. Please see example.

Code: Select all
      this.oracleCommand2.CommandText = "INSERT INTO ODAC_CLOB\n  (CODE, VALUE)\nVALUES\n  (:CODE, :VALUE)\n";
      this.oracleCommand2.Parameters.Add(new CoreLab.Oracle.OracleParameter("CODE", CoreLab.Oracle.OracleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
      this.oracleCommand2.Parameters.Add(new CoreLab.Oracle.OracleParameter("VALUE", CoreLab.Oracle.OracleDbType.Clob, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));

      oracleConnection1.Open();
      ((OracleParameter)oracleCommand2.Parameters[0]).ArrayLength = 3;
      ((OracleParameter)oracleCommand2.Parameters[0]).Value = new int[3]{21,22,23};
      ((OracleParameter)oracleCommand2.Parameters[1]).ArrayLength = 3;
      ((OracleParameter)oracleCommand2.Parameters[1]).Value = new string[3]{"21","22","23"};
      oracleCommand2.ExecuteArray(3);
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Postby Paul » Tue 30 May 2006 06:28

Send us please small demo project to OraDirect .NET support address to demonstrate the problem and include script to create server objects (tables).
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06


Return to dotConnect for Oracle