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 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; 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: