Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

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

All Rights Reserved.

Home

Book List

Contents