Skip Headers

Oracle C++ Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96583-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCCI Classes and Methods, 13 of 22


MetaData Class

A MetaData object can be used to describe the types and properties of the columns in a ResultSet or the existing schema objects in the database. It also provides information about the database as a whole.

Listing of the parameter types for objects:

Listing of attribute values:

These are returned on executing a get method passing some attribute for which these are the results.

To..., use the syntax:

MetaData(const MetaData &omd);

omd

The source metadata object to be copied from.

Summary of MetaData Methods

Table 8-13 MetaData Methods  
Method Summary

getAttributeCount()

Gets the count of the attribute as a MetaData object

getAttributeId()

Gets the ID of the specified attribute

getAttributeType()

Gets the type of the specified attribute.

getBoolean()

Gets the value of the attribute as a C++ boolean.

getInt()

Gets the value of the attribute as a C++ int.

getMetaData()

Gets the value of the attribute as a MetaData object

getNumber()

Returns the specified attribute as a Number object.

getRef()

Gets the value of the attribute as a Ref<T>.

getString()

Gets the value of the attribute as a string.

getTimeStamp()

Gets the value of the attribute as a Timestamp object

getUInt()

Gets the value of the attribute as a C++ unsigned int.

getVector()

Gets the value of the attribute as an C++ vector.

operator=()

Assigns one metadata object to another.

getAttributeCount()

This method returns the number of attributes related to the metadata object.

Syntax
unsigned int getAttributeCount() const;

getAttributeId()

This method returns the attribute ID (ATTR_NUM_COLS, . . . ) of the attribute represented by the attribute number specified.

Syntax
AttrId getAttributeId(unsigned int attributenum) const;
Parameters
attributenum

The number of the attribute for which the attribute ID is to be returned.

getAttributeType()

This method returns the attribute type (NUMBER, INT, . . . ) of the attribute represented by attribute number specified.

Syntax
Type getAttributeType(unsigned int attributenum) const;
Parameters
attributenum

The number of the attribute for which the attribute type is to be returned.

getBoolean()

This method returns the value of the attribute as a C++ boolean. If the value is a SQL null, the result is false.

Syntax
bool getBoolean(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getInt()

This method returns the value of the attribute as a C++ int. If the value is SQL null, the result is 0.

Syntax
int getInt(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID .

getMetaData()

This method returns a MetaData instance holding the attribute value. A metadata attribute value can be retrieved as a MetaData instance. This method can only be called on attributes of the metadata type.

Syntax
MetaData getMetaData(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getNumber()

This method returns the value of the attribute as a Number object. If the value is a SQL null, the result is null.

Syntax
Number getNumber(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getRef()

This method returns the value of the attribute as a RefAny. If the value is SQL null, the result is null.

Syntax
RefAny getRef(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getString()

This method returns the value of the attribute as a string. If the value is SQL null, the result is null.

Syntax
string getString(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getTimeStamp()

This method returns the value of the attribute as a Timestamp object. If the value is a SQL null, the result is null.

Syntax
Timestamp getTimestamp(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getUInt()

This method returns the value of the attribute as a C++ unsigned int. If the value is a SQL null, the result is 0.

Syntax
unsigned int getUInt(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

getVector()

This method returns a C++ vector containing the attribute value. A collection attribute value can be retrieved as a C++ vector instance. This method can only be called on attributes of a list type.

Syntax
vector<MetaData> getVector(MetaData::AttrId attrid) const;
Parameters
attrid

The attribute ID.

operator=()

This method assigns one MetaData object to another. This increments the reference count of the MetaData object that is assigned.

Syntax
void operator=(const MetaData &omd);
Parameters
omd

MetaData object to be assigned.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback