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

Remove Method

Applies To

OParameterCollection

Description

This method removes a parameter from a database.

Usage

oresult Remove(int index) const

oresult Remove(const char *pname) const

Arguments
Description
index
An index from 0 to OParameterCollection.GetCount()-1.
pname
The name of the parameter, as stated when the parameter was created with Add.
Remarks

Parameters are attached to a database using OParameterCollection::Add. Once attached they will stay in existence. When you no longer need a parameter you can remove it using the Remove method. This will reduce overhead in the processing of SQL statements.

For an OParameter class of OTYPE_CURSOR, this method destroys the dynaset object associated with the cursor and clears the local cache temporary files.

Return Value

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

Example

Adding and removing a parameter

// open a database

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

OParameterCollection pcoll = odb.GetParameters();

// add a parameter

pcoll.Add("param1", 34, OPARAMETER_INVAR, OTYPE_NUMBER);

// now remove it

pcoll.Remove("param1");