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!

Does ORACLE BulkCopy using ODP.Net support XMLType columns ?

John TicehurstJun 30 2020 — edited Jul 1 2020

Hi,

Does ORACLE BulkCopy using ODP.Net support XMLType columns ?

I am trying this with the Oracle DataAccess.dll 4.122.1.0

The following console app throws an Unsupported column datatype exception for the FREDDO table

Thanks,

John

CREATE TABLE  PERF.FREDDO 

(

PRIMEACNO  NUMBER(9,0),

TRANCODE  xmltype

   )

using System;

using System.Data;

using Oracle.DataAccess.Client;

namespace ConsoleApp6

{

class Program

{

static void Main(string[] args)

{

WriteToServer(CreateDataTable());

}

public static void WriteToServer(DataTable dataTable)

{

try

{

using (OracleConnection Oracleconnection = new OracleConnection(connstring))

{

Oracleconnection.Open();

using (OracleBulkCopy bulkCopy = new OracleBulkCopy(Oracleconnection))

{

bulkCopy.DestinationTableName = "PERF.FREDDO";

bulkCopy.WriteToServer(dataTable);

}

}

}

catch (Exception exc)

{

}

}

public static DataTable CreateDataTable()

{

try

{

DataTable table = new DataTable();

DataColumn idDataColumn = new DataColumn("PRIMEACNO", typeof(decimal));

idDataColumn.AllowDBNull = false;

table.Columns.Add(idDataColumn);

DataColumn nameDataColumn = new DataColumn("TRANCODE", typeof(string));

nameDataColumn.AllowDBNull = false;

table.Columns.Add(nameDataColumn);

DataRow row = table.NewRow();

row["PRIMEACNO"] = 1;

row["TRANCODE"] = "<item1><item2>64</item2></item1>";

table.Rows.Add(row);

return table;

}

catch (Exception exc)

{

return null;

}

}

}

}

This post has been answered by Alex Keh-Oracle on Jun 30 2020
Jump to Answer

Comments

Alex Keh-Oracle
Answer

No, XMLType is not supported in Bulk Copy. Here is the list of Bulk Copy supported data types.

Marked as Answer by John Ticehurst · Sep 27 2020
John Ticehurst

Thanks,

Is there anything in the schedule that will allow this datatype to be supported ?

When/if Bulkcopy moves into the managed ODP.Net code will it be supported then ?

John

Alex Keh-Oracle

Not in the short term. We haven't seen many requests for this enhancement.

1 - 3

Post Details

Added on Jun 30 2020
3 comments
240 views