Link Search Menu Expand Document

OracleBulkInsertMapItem


This class extends BulkInsertMapItem with an optional, explicit OracleDbType to bind with for the mapped column. When not provided, the type is inferred from the entity property’s OracleDbType/OracleDbTypeEx attribute (if present) or, failing that, from the .NET CLR value itself.

Used by the Oracle BulkInsert, BulkMerge and BulkUpdate operations.

Create a new Instance

var mapItem = new OracleBulkInsertMapItem("SourceId", "DestinationId");

Or with an explicit OracleDbType:

var mapItem = new OracleBulkInsertMapItem("SourceName", "DestinationName", OracleDbType.NVarchar2);

Usage for BulkOperations

var mappings = new []
{
    new OracleBulkInsertMapItem("FirstName", "FName"),
    new OracleBulkInsertMapItem("LastName", "LName"),
    new OracleBulkInsertMapItem("Age", "Age", OracleDbType.Int32)
};

using (var connection = new OracleConnection(connectionString))
{
    var people = GetPeople(100000);
    connection.BulkInsert(people, mappings: mappings);
}

The same approach applies to BulkMerge and BulkUpdate. The mappings argument is optional — omitting it causes the library to auto-map columns by name (case-insensitive).