Hi,
OracleBulkCopy throws ORA-16550: truncated result https://docs.oracle.com/error-help/db/ora-16550/;
Stack trace:
at Oracle.ManagedDataAccess.Client.OracleBulkCopy.WriteDataSourceToServer(IBulkCopyDataSource dataSource)
at Oracle.ManagedDataAccess.Client.OracleBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
at Oracle.ManagedDataAccess.Client.OracleBulkCopy.WriteToServer(DataTable table)
It does not matter if I use float, double, or decimal. The maximum digits that can be handled is 5:
(1.2345, 12.345, 123.45, 1234.5, etc.)
What can I do to bulk copy data to a database table with FLOAT(53) columns?
This code can be used to reproduce the issue:
using var connection = new OracleConnection("connection_string");
await connection.OpenAsync();
using OracleBulkCopy bulk = new(connection);
var dataTable = CreateTestDataTable();
bulk.BatchSize = 1000;
bulk.DestinationTableName = dataTable.TableName;
bulk.WriteToServer(dataTable);
await connection.CloseAsync();
public DataTable CreateTestDataTable()
{
DataTable dataTable = new("TestTable");
dataTable.Columns.Add(new DataColumn("MyValue", typeof(decimal)) { AllowDBNull = true });
DataRow row = dataTable.NewRow();
row["MyValue"] = 123.456;
dataTable.Rows.Add(row);
return dataTable;
}