Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

ServerErrorNumber Method

Applies To

OSession

ODatabase

Description

This method returns the Oracle error number for the last database-related error in the session.

Usage

long ServerErrorNumber(void) const;

Remarks

This method returns the Oracle error number for the most recent database-related error, if there has been an error since the session was created or the server error was reset with ServerErrorReset. Errors that occur while opening a database or in a transactional method will be reported on the session. Other errors are reported on the database.

A value of 0 means no error.

Return Value

Returns the Oracle error number.

Example

An example of a server error:

// open an ODatabase object

ODatabase odb("ExampleDB", "scott", "tiger");

// try to open a dynaset with a bad column name

ODynaset dyn(odb, "select xx from emp");

// if that didn't work, get the error number

if (!dyn.IsOpen())

{

long errno = odb.ServerErrorNumber();

}