Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
|
Applies To
Description
This method removes a parameter from a database.
Usage
oresult Remove(int index) const
oresult Remove(const char *pname) const
Arguments
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. |
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");