The OracleBulkCopyColumnMapping
class defines the mapping between a column in the data source and a column in the destination database table.
System.Object
System.OracleBulkCopyColumnMapping
// C# public sealed class OracleBulkCopyColumnMapping
Provider | ODP.NET, Unmanaged Driver |
Assembly | Oracle.DataAccess.dll |
Namespace | Oracle.DataAccess.Client |
.NET Framework | 3.5, 4.0, 4.5 |
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
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.// C#
See Also:
OracleBulkCopyColumnMapping
members are listed in the following tables.
OracleBulkCopyColumnMapping Constructors
The OracleBulkCopyColumnMapping
constructors are listed in Table 17-8.
Table 17-8 OracleBulkCopyColumnMapping Constructors
Constructor | Description |
---|---|
Instantiates new instances of the |
OracleBulkCopyColumnMapping Methods
The OracleBulkCopyColumnMapping
method is listed in Table 17-9.
Table 17-9 OracleBulkCopyColumnMapping Method
Constructor | Description |
---|---|
Compares the current instance to the supplied object and returns an integer that represents their relative values |
OracleBulkCopyColumnMapping Properties
The OracleBulkCopyColumnMapping
properties are listed in Table 17-10.
Table 17-10 OracleBulkCopyColumnMapping Properties
Property | Description |
---|---|
Specifies the column name of the destination table that is being mapped |
|
Specifies the column ordinal value of the destination table that is being mapped |
|
Specifies the column name of the data source that is being mapped |
|
Specifies the column ordinal value of the data source that is being mapped |
OracleBulkCopyColumnMapping
constructors instantiates new instances of the OracleBulkCopyColumnMapping
class.
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class
OracleBulkCopyColumnMapping(int, int)
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column ordinal and destination column ordinal.
OracleBulkCopyColumnMapping(int, string)
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column ordinal and destination column name.
OracleBulkCopyColumnMapping(string, int)
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column name and destination column ordinal.
OracleBulkCopyColumnMapping(string, string)
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column name and destination column name.
See Also:
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class.
// C# public OracleBulkCopyColumnMapping();
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.
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source and destination column ordinal positions.
// C# public OracleBulkCopyColumnMapping(int sourceColumnOrdinal, int destinationOrdinal);
sourceColumnOrdinal
The ordinal position of the source column within the data source.
destinationOrdinal
The ordinal position of the destination column within the destination table.
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column ordinal and destination column name.
// C# public OracleBulkCopyColumnMapping(int sourceColumnOrdinal, string destinationColumn);
sourceColumnOrdinal
The ordinal position of the source column within the data source.
destinationColumn
The name of the destination column within the destination table.
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source column name and destination column ordinal.
// C# public OracleBulkCopyColumnMapping(string sourceColumn, int destinationOrdinal);
sourceColumn
The name of the source column within the data source.
destinationOrdinal
The ordinal position of the destination column within the destination table.
This constructor instantiates a new instance of the OracleBulkCopyColumnMapping
class using the provided source and destination column names.
// C# public OracleBulkCopyColumnMapping(string sourceColumn, string destinationColumn);
sourceColumn
The name of the source column within the data source.
destinationColumn
The name of the destination column within the destination table.
The OracleBulkCopyColumnMapping
method is listed in Table 17-11.
Table 17-11 OracleBulkCopyColumnMapping Method
Property | Description |
---|---|
Compares the current instance to the supplied object and returns an integer that represents their relative values |
See Also:
This method compares the current instance to the supplied object and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj - The supplied instance.
Less than zero: if the value of the current instance is less than obj.
Zero: if the value of the current instance is equal to obj.
Greater than zero: if the value of the current instance is greater than obj.
IComparable
The OracleBulkCopyColumnMapping
properties are listed in Table 17-12.
Table 17-12 OracleBulkCopyColumnMapping Properties
Property | Description |
---|---|
Specifies the column name of the destination table that is being mapped |
|
Specifies the column ordinal value of the destination table that is being mapped |
|
Specifies the column name of the data source that is being mapped |
|
Specifies the column ordinal value of the data source that is being mapped |
See Also:
This property specifies the column name of the destination table that is being mapped.
// C# public string DestinationColumn {get; set;}
A string value that represents the destination column name of the mapping.
The DestinationColumn
and DestinationOrdinal
properties are mutually exclusive. The last value set takes precedence.
This property specifies the column ordinal value of the destination table that is being mapped.
// C# public int DestinationOrdinal {get; set;}
An integer value that represents the destination column ordinal of the mapping.
IndexOutOfRangeException
- The destination ordinal is invalid.
The DestinationOrdinal
and DestinationColumn
properties are mutually exclusive. The last value set takes precedence.
This property specifies the column name of the data source that is being mapped.
// C# public string SourceColumn {get; set;}
A string value that represents the source column name of the mapping.
The SourceColumn
and SourceOrdinal
properties are mutually exclusive. The last value set takes precedence.
This property specifies the column ordinal value of the data source that is being mapped.
// C# public int SourceOrdinal {get; set;}
An integer value that represents the source column ordinal of the mapping.
IndexOutOfRangeException
- The source ordinal is invalid.
The SourceOrdinal
and SourceColumn
properties are mutually exclusive. The last value set takes precedence.