The OracleError
class represents an error reported by Oracle.
System.Object
Oracle.DataAccess.Client.OracleError
// C# public sealed class OracleError
Provider | ODP.NET, Unmanaged Driver | ODP.NET, Managed Driver |
Assembly | Oracle.DataAccess.dll |
Oracle.ManagedDataAccess.dll |
Namespace | Oracle.DataAccess.Client |
Oracle.ManagedDataAccess.Client |
.NET Framework | 3.5, 4.0, 4.5 | 4.0, 4.5 |
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
The OracleError
class represents a warning or an error reported by Oracle.
If there are multiple errors, ODP.NET only returns the first error message on the stack.
// C# using System; using System.Data; using Oracle.DataAccess.Client; class OracleErrorsSample { static void Main() { string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); // Create an OracleCommand object using the connection object OracleCommand cmd = con.CreateCommand(); try { cmd.CommandText = "insert into notable values (99, 'MyText')"; cmd.ExecuteNonQuery(); } catch (OracleException ex) { Console.WriteLine("Record is not inserted into the database table."); foreach (OracleError error in ex.Errors) { Console.WriteLine("Error Message: " + error.Message); Console.WriteLine("Error Source: " + error.Source); } } } }
See Also:
OracleError
members are listed in the following tables.
The OracleError
static method is listed in Table 6-63.
Table 6-63 OracleError Static Method
Method | Description |
---|---|
|
Inherited from |
OracleError
properties are listed in Table 6-64.
Table 6-64 OracleError Properties
Property | Description |
---|---|
Specifies the row number of errors that occurred during the Array Bind execution |
|
Specifies the Oracle service name (TNS name) that identifies the Oracle database |
|
Specifies the |
|
Specifies the Oracle |
|
Specifies the stored procedure that causes the |
|
Specifies the name of the data provider that generates the |
OracleError
methods are listed in Table 6-65.
The OracleError
static method is listed in Table 6-66.
OracleError
properties are listed in Table 6-67.
Table 6-67 OracleError Properties
Property | Description |
---|---|
Specifies the row number of errors that occurred during the Array Bind execution |
|
Specifies the Oracle service name (TNS name) that identifies the Oracle database |
|
Specifies the |
|
Specifies the Oracle |
|
Specifies the stored procedure that causes the |
|
Specifies the name of the data provider that generates the |
See Also:
This property specifies the row number of errors that occurred during the Array Bind execution.
// C# public int ArrayBindIndex {get;}
An int
value that specifies the row number for errors that occurred during the Array Bind execution.
Default = 0.
This property is used for Array Bind operations only.
ArrayBindIndex
represents the zero-based row number at which the error occurred during an Array Bind operation. For example, if an array bind execution causes two errors on the 2nd and 4th operations, two OracleError
objects appear in the OracleErrorCollection
with the ArrayBindIndex
property values 2 and 4 respectively.
This property specifies the Oracle service name (TNS name) that identifies the Oracle database.
// C# public string DataSource {get;}
A string
.
This property specifies the message
describing the error
.
// C# public string Message {get;}
A string
.
This property specifies the stored procedure that causes the error
.
// C# public string Procedure {get;}
The stored procedure name.
Represents the stored procedure which creates this OracleError
object.
OracleError
methods are listed in Table 6-68.
Table 6-68 OracleError Methods
Method | Description |
---|---|
|
Inherited from |
|
Inherited from |
|
Inherited from System. |
Returns a string representation of the |
See Also: