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

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, 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