See Also

OracleLoader Members  | Devart.Data.Oracle Namespace  | OracleLoaderColumn Class  | OracleLoaderColumnCollection Class  | OracleDbType Enumeration


Visual Basic


Show All

See AlsoLanguagesDevart.Data.OracleSend comments on this topic.

OracleLoader Class

Devart.Data.Oracle Namespace : OracleLoader Class

Serves to load external data into the Oracle database.

For a list of all members of this type, see OracleLoader members.

Inheritance Hierarchy



[Visual Basic]
Public Class OracleLoader    Inherits DbLoader    Implements IComponentIDisposable 
public class OracleLoader : DbLoader, IComponentIDisposable 


In OCI mode OracleLoader uses direct path load interface to speed up loading. In Direct mode it uses array binding feature. To specify the name of table to load set TableName property. Use Columns property to access individual columns. See example below and Loader sample for detailed information.

As an alternative to providing values in code, demonstrated in the sample below, you can use the Devart.Common.DbLoader.LoadTable method overloads to load data directly from a DataTable, IDataReader, or an array of DataRows.

If you use direct path loading without PartitionName specified, the PRIMARY KEY, UNIQUE, and NOT NULL constaints of the target table are enabled when loading data with OracleLoader. Additionally, you can turn off disabling constraints even when PartitionName is specified with OracleLoaderOptions.KeepConstraints option. Keeping these constraints enebled may cause the following consequences:

Restrictions of OracleLoader (only for direct path loading):

The following types are supported when using direct path loading:

If an unsupported type is found, OracleLoader works via array binding.

You can additionally tweak OracleLoader behavior via its Options property. It allows you to configure OracleLoader to always use array binding even when direct path can be used, not to disable check constraint, aditionally disable indexes, trigger, table logging, etc. See OracleLoaderOptions for more information.

When array binding is used in the OCI connection mode with Oracle 11g Release 2 or higher, OracleLoader generates SQL with the /* APPEND_VALUES */ hint to avoid logging inserts for tables with logging disabled (NOLOGGING).

This class is available only in Professional and Developer Editions. It is not available in Standard and Mobile Editions.


The following example creates an OracleLoader, then populates Columns collection from table description, loads data, flushes the buffer and disposes internal OracleLoader structures. The OracleLoader requires open connection.

The following table is used in this example:



public void LoadData(OracleConnection conn) 

  // OracleLoader requires open connection 
  if (conn.State == ConnectionState.Closed) 
  OracleLoader loader = new OracleLoader(); 
  // Specify connection that OracleLoader will use for loading 
  loader.Connection = conn; 
  // Set table name that will be loaded into 
  loader.TableName = "load_table"; 
  // Populate Columns collection from table description 
  // Prepare OracleLoader for loading 
  for (int i = 0; i < 10000; i++) 
    loader.SetValue("id", i); 
    loader.SetValue("char_field", "test string"); 
    loader.SetValue("date_field", DateTime.Now); 
  // Flush buffer and dispose internal OracleLoader structures 

[Visual Basic] 

Public Sub LoadData(conn As OracleConnection)
  ' OracleLoader requires open connection
  If conn.State = ConnectionState.Closed
  End If
  Dim loader As OracleLoader
  loader = new OracleLoader
  ' Specify connection that OracleLoader will use for loading
  loader.Connection = conn
  ' Set table name that will be loaded into
  loader.TableName = "load_table"
  ' Populate Columns collection from table description
  ' Prepare OracleLoader for loading
  Dim i As Integer
  For i = 0 To 9999
    loader.SetValue("id", i)
    loader.SetValue("char_field", "test string")
    loader.SetValue("date_field", DateTime.Now)
  Next i
  ' Flush buffer and dispose internal OracleLoader structures
End Sub

See Also

OracleLoader Members  | Devart.Data.Oracle Namespace  | OracleLoaderColumn Class  | OracleLoaderColumnCollection Class  | OracleDbType Enumeration



© 2002 - 2016 Devart. All Rights Reserved.