Oracle Objects for OLE C++ Class Library
Release 9.2

Part Number A95896-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

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();

}


 
Oracle
Copyright © 1998, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback