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

operator int

Applies To

OField

OParameter

OValue

Description

This method returns the object's value as an int.

Usage

operator int() const

Remarks

This method hands the value of the object back to the caller as an int. If the object's current value is not an int, the method attempts to convert the value. This can fail, resulting in a return of the value 0.

Return Value

The value of the field as an int; 0 on failure.

Example

Look for the employee with a certain employee number:

// open the ODatabase

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

// open the dynaset

ODynaset odyn(odb, "select * from emp");

// get a field on the id

OField enof = odyn.GetField("empno");

// now look for the id we want

while (!odyn.IsEOF())

{

// we'll examine the value of the id field in this record simply

// by casting the enof OField variable

if ((int) enof == targetid)

break;

}