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

OParameter Method

Applies To

OParameter

Description

OParameter constructor

Usage

OParameter(void)

OParameter(const OParameter &otherparam)

Arguments

otherparam
Another OParameter object that you are copying.
Remarks

These methods construct a new OParameter instance.

The default constructor constructs an unopened OParameter object. It cannot fail.

The copy constructor copies another OParameter object. If that other OParameter object is open - which means it is a handle on an implementation parameter object - the new OParameter object becomes a handle to that same parameter object. The copy constructor copies the reference to the parameter object but does not copy any strings that the source OParameter may own. The copy constructor can fail; check whether the new OParameter is open after the constructor call.

There is no Open method for the OParameter class. To get an open OParameter, call the GetParameter method of the OParameterCollection class. The way that a parameter is actually created is by the OParameterCollection::Add method.

Example

This example creates a parameter and constructs an OParameter object.

// open a database

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

OParameterCollection params = odb.GetParameters();

OParameter deptp;

deptp = params.Add("dno", 20, OPARAMETER_INVAR, OTYPE_NUMBER);

/*

By using the = operator we are invoking the copy constructor. It is copying the temporary object that is returned by the Add method.

*/

// use it

ODynaset empdyn;

empdyn.Open(odb, "select * from emp where deptno = :dno");


 
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