Serves to execute series of SQL statements separated by special symbols, like SQL*Plus scripts.
Following example executes a script and handles script errors.
|
|---|
public void ExecuteScript(string sql, OracleConnection conn) {
OracleScript script = new OracleScript(sql, conn);
script.Error += new ScriptErrorEventHandler(this.OnError);
script.Execute();
}
public void OnError(object sender, Devart.Common.ScriptErrorEventArgs e) {
Console.WriteLine(e.Exception.Message);
e.Ignore = true;
} |
|
|---|
Public Sub ExecuteScript(ByVal Sql As String, ByVal conn As OracleConnection)
Dim Script As OracleScript = New OracleScript(Sql, conn)
AddHandler Script.Error, AddressOf OnError
Script.Execute()
End Sub
Public Sub OnError(ByVal Sender As Object, ByVal e As Devart.Common.ScriptErrorEventArgs)
Console.WriteLine(e.Exception.Message)
e.Ignore = True
End Sub |