Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
Release 9.2.0.4

Part Number B10954-01
Go To Table Of Contents
Contents

Clear Method

Applies To

OValue

OParameter

Description

This method clears the value stored in the object, leaving a value of NULL.

Usage

oresult Clear(void)

Remarks

Oracle database columns may have a value of NULL. This database NULL means "no value specified", rather than the NULL pointer of C++. Sometimes it is desirable to generate a NULL value. The Clear method makes the OValue or OParameter object hold a NULL value.

Return Value

An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).

Example

This example gets a value from a dynaset and then sets it to NULL.

// we have a dynaset named empdyn

// get the current commission value

OValue commission;

empdyn.GetFieldValue("comm", &commission);

// if the commission has a value, change it to NULL

if (!commission.IsNull())

{ // make the commission NULL

commission.Clear();

empdyn.StartEdit();

empdyn.SetFieldValue("comm", commission);

empdyn.Update();

}


 
Oracle
Copyright © 1998, 2003 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents