OracleBulkCopyOptions Enumeration
The OracleBulkCopyOptions
enumeration specifies the values that can be combined with an instance of the OracleBulkCopy
class and used as options to determine its behavior and the behavior of the WriteToServer
methods for that instance.
Table 17-17 lists all the OracleBulkCopyOptions
enumeration values with a description of each enumerated value.
Table 17-17 OracleBulkCopyOptions Enumeration Members
Member Name | Description |
---|---|
|
Indicates that the default value for all options are to be used |
|
Indicates when a direct path load results in an index-related error, the load is aborted. No rows are loaded, and indexes remain unchanged. When this option is not specified and a direct path load results in an index becoming unusable, the rows are loaded and the index is left in an unusable state. Oracle database primary key and unique constraints are enforced using unique indexes, which means the database automatically creates unique indexes on columns specified as primary key or unique. Therefore, this option only affects primary key and unique constraints. This option behavior is similar to the This member is supported with managed ODP.NET and ODP.NET Core 23.8 and higher. Note: While using ODP.NET bulk copy, the check and not null constraints are automatically enforced, whereas the foreign key constraint is never enforced. |
|
Indicates when bulk copy has processed all the rows by sending a notification. This member can be used in conjunction with For example, let's say you set
By design, This member is supported with managed ODP.NET and ODP.NET Core only starting with versions 23.5, 21.15, and 19.24. |
|
Indicates that each batch of the bulk copy operation occurs within a transaction. If the connection used to perform the bulk copy operation is already part of a transaction, an If this member is not specified, |
Note:
All bulk copy operations are agnostic of any local or distributed transaction created by the application.
Requirements
Provider | ODP.NET, Unmanaged Driver | ODP.NET, Managed Driver | ODP.NET Core |
---|---|---|---|
Assembly |
|
|
|
Namespace |
|
|
|
.NET Framework |
- |
||
.NET (Core) |
- |
- |
Sample Code: NotifyAllRowsProcessed
// Set up the bulk copy object so that it will notify the app when all rows have been copied. using (OracleBulkCopy bulkCopy = new OracleBulkCopy(destinationConnection, OracleBulkCopyOption.NotifyAllRowsProcessed)) { bulkCopy.DestinationTableName = "BLOGS"; try { // Write rows from the source to the destination. bulkCopy.NotifyAfter = 5; // OnSqlRowsCopied is the event handler delegate whenever NotifyAfter or NotifyAlRowsProcessed sends a notification. OnSqlRowsCopied's implementation is not included in this code sample. bulkCopy.OracleRowsCopied += new OracleRowsCopiedEventHandler(OnSqlRowsCopied); bulkCopy.WriteToServer(reader); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { // Close the OracleDataReader. The OracleBulkCopy object is automatically closed at the end of the using block. reader.Close(); } }
See Also: