| 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.
Devart.Common.DbLoader
Devart.Data.Oracle.OracleLoader
[Visual Basic]
Public Class OracleLoader
Inherits DbLoader
Implements IComponent , IDisposable [C#]
public class OracleLoader : DbLoader, IComponent , IDisposable The OracleLoader uses direct path load interface to speed up loading. 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.
OracleLoader class is not available in OracleConnection.Direct mode. OracleLoader cannot function when OracleConnection.Unicode is true.
The PRIMARY KEY, UNIQUE, and NOT NULL constaints are enabled when loading data with OracleLoader:
Restrictions of OracleLoader:
The following types are supported in OracleLoader:
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:
CREATE TABLE LOAD_TABLE( ID NUMBER, CHAR_FIELD VARCHAR(20), DATE_FIELD DATE, CONSTRAINT PK_LOAD_TABLE PRIMARY KEY (ID) );
[C#]
public void LoadData(OracleConnection conn)
{
// OracleLoader requires open connection
if (conn.State == ConnectionState.Closed)
conn.Open();
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
loader.CreateColumns();
// Prepare OracleLoader for loading
loader.Open();
for (int i = 0; i < 10000; i++)
{
loader.SetValue("id", i);
loader.SetValue("char_field", "test string");
loader.SetValue("date_field", DateTime.Now);
loader.NextRow();
}
// Flush buffer and dispose internal OracleLoader structures
loader.Close();
} [Visual Basic]
Public Sub LoadData(conn As OracleConnection)
' OracleLoader requires open connection
If conn.State = ConnectionState.Closed
conn.Open()
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
loader.CreateColumns()
' Prepare OracleLoader for loading
loader.Open()
Dim i As Integer
For i To 10000
loader.SetValue("id", i)
loader.SetValue("char_field", "test string")
loader.SetValue("date_field", DateTime.Now)
loader.NextRow()
Next i
' Flush buffer and dispose internal OracleLoader structures
loader.Close()
End SubOracleLoader Members | Devart.Data.Oracle Namespace | OracleLoaderColumn Class | OracleLoaderColumnCollection Class
© 2002 - 2013 Devart. All Rights Reserved.