OracleBulkCopyColumnMapping Class

The OracleBulkCopyColumnMapping class defines the mapping between a column in the data source and a column in the destination database table.

Class Inheritance

System.Object

  System.OracleBulkCopyColumnMapping

Declaration

// C#
public sealed class OracleBulkCopyColumnMapping

Thread Safety

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

Remarks

Column mappings define the mapping between data source and the target table.

It is not necessary to specify column mappings for all the columns in the data source. If a ColumnMapping is not specified, then, by default, columns are mapped based on the ordinal position. This succeeds only if the source and destination table schema match. If there is a mismatch, an InvalidOperationException is thrown.

All the mappings in a mapping collection must be by name or ordinal position.

Note:

Oracle Data Provider for .NET makes one or more round-trips to the database to determine the column name if the mapping is specified by ordinal position. To avoid this performance overhead, specify the mapping by column name.

Example

// C#

Requirements

Namespace: Oracle.DataAccess.Client

Assembly: Oracle.DataAccess.dll

Microsoft .NET Framework Version: 1.0 or later


OracleBulkCopyColumnMapping Members

OracleBulkCopyColumnMapping members are listed in the following tables.

OracleBulkCopyColumnMapping Constructors

The OracleBulkCopyColumnMapping constructors are listed in Table 15-8.

Table 15-8 OracleBulkCopyColumnMapping Constructors

Constructor Description

OracleBulkCopyColumnMapping Constructors

Instantiates new instances of the OracleBulkCopyColumnMapping class


OracleBulkCopyColumnMapping Properties

The OracleBulkCopyColumnMapping properties are listed in Table 15-9.

Table 15-9 OracleBulkCopyColumnMapping Properties

Property Description

DestinationColumn

Specifies the column name of the destination table that is being mapped

DestinationOrdinal

Specifies the column ordinal value of the destination table that is being mapped

SourceColumn

Specifies the column name of the data source that is being mapped

SourceOrdinal

Specifies the column ordinal value of the data source that is being mapped



OracleBulkCopyColumnMapping Constructors

OracleBulkCopyColumnMapping constructors instantiates new instances of the OracleBulkCopyColumnMapping class.

Overload List:

OracleBulkCopyColumnMapping()

This constructor instantiates a new instance of the OracleBulkCopyColumnMapping class.

Declaration

// C#
public OracleBulkCopyColumnMapping();

Remarks

Applications that use this constructor must define the source for the mapping using the SourceColumn or SourceOrdinal property, and must define the destination for the mapping using the DestinationColumn or DestinationOrdinal property.

OracleBulkCopyColumnMapping(int, int)

This constructor instantiates a new instance of the OracleBulkCopyColumnMapping class using the provided source and destination column ordinal positions.

Declaration

// C#
public OracleBulkCopyColumnMapping(int sourceColumnOrdinal, 
   int destinationOrdinal);

Parameters

  • sourceColumnOrdinal

    The ordinal position of the source column within the data source.

  • destinationOrdinal

    The ordinal position of the destination column within the destination table.

OracleBulkCopyColumnMapping(int, string)

This constructor instantiates a new instance of the OracleBulkCopyColumnMapping class using the provided source column ordinal and destination column name.

Declaration

// C#
public OracleBulkCopyColumnMapping(int sourceColumnOrdinal, 
   string destinationColumn);

Parameters

  • sourceColumnOrdinal

    The ordinal position of the source column within the data source.

  • destinationColumn

    The name of the destination column within the destination table.

OracleBulkCopyColumnMapping(string, int)

This constructor instantiates a new instance of the OracleBulkCopyColumnMapping class using the provided source column name and destination column ordinal.

Declaration

// C#
public OracleBulkCopyColumnMapping(string sourceColumn, int destinationOrdinal);

Parameters

  • sourceColumn

    The name of the source column within the data source.

  • destinationOrdinal

    The ordinal position of the destination column within the destination table.

OracleBulkCopyColumnMapping(string, string)

This constructor instantiates a new instance of the OracleBulkCopyColumnMapping class using the provided source and destination column names.

Declaration

// C#
public OracleBulkCopyColumnMapping(string sourceColumn, string destinationColumn);

Parameters

  • sourceColumn

    The name of the source column within the data source.

  • destinationColumn

    The name of the destination column within the destination table.


OracleBulkCopyColumnMapping Properties

The OracleBulkCopyColumnMapping properties are listed in Table 15-10.

Table 15-10 OracleBulkCopyColumnMapping Properties

Property Description

DestinationColumn

Specifies the column name of the destination table that is being mapped

DestinationOrdinal

Specifies the column ordinal value of the destination table that is being mapped

SourceColumn

Specifies the column name of the data source that is being mapped

SourceOrdinal

Specifies the column ordinal value of the data source that is being mapped


DestinationColumn

This property specifies the column name of the destination table that is being mapped.

Declaration

// C#
public string DestinationColumn {get; set;}

Property Value

A string value that represents the destination column name of the mapping.

Remarks

The DestinationColumn and DestinationOrdinal properties are mutually exclusive. The last value set takes precedence.

DestinationOrdinal

This property specifies the column ordinal value of the destination table that is being mapped.

Declaration

// C#
public int DestinationOrdinal {get; set;}

Property Value

An integer value that represents the destination column ordinal of the mapping.

Exceptions

IndexOutOfRangeException - The destination ordinal is invalid.

Remarks

The DestinationOrdinal and DestinationColumn properties are mutually exclusive. The last value set takes precedence.

SourceColumn

This property specifies the column name of the data source that is being mapped.

Declaration

// C#
public string SourceColumn {get; set;}

Property Value

A string value that represents the source column name of the mapping.

Remarks

The SourceColumn and SourceOrdinal properties are mutually exclusive. The last value set takes precedence.

SourceOrdinal

This property specifies the column ordinal value of the data source that is being mapped.

Declaration

// C#
public int SourceOrdinal {get; set;}

Property Value

An integer value that represents the source column ordinal of the mapping.

Exceptions

IndexOutOfRangeException - The source ordinal is invalid.

Remarks

The SourceOrdinal and SourceColumn properties are mutually exclusive. The last value set takes precedence.