Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

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 © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents