Skip Headers

Oracle® C++ Call Interface Programmer's Guide
10g Release 1 (10.1)

Part Number B10778-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

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. The parameter types for objects are listed in Table 10-24.

Table 10-24 Parameter Types for Objects

Parameter Type Description
PTYPE_ARG
argument of a function or procedure
PTYPE_COL
column of a table or view
PTYPE_DATABASE
database
PTYPE_FUNC
function
PTYPE_PKG
package
PTYPE_PROC
procedure
PTYPE_SCHEMA
schema
PTYPE_SEQ
sequence
PTYPE_SYN
synonym
PTYPE_TABLE
table
PTYPE_TYPE
type
PTYPE_TYPE_ARG
argument of a type method
PTYPE_TYPE_ATTR
attribute of a type
PTYPE_TYPE_COLL
collection type information
PTYPE_TYPE_METHOD
method of a type
PTYPE_TYPE_RESULT
results of a method
PTYPE_TYPE_UNK
object of an unknown type
PTYPE_TYPE_VIEW
view

Attribute values are returned on executing a getxxx() method, passing some attribute for which these are the results:

Table 10-25 Enumerated Values of Attributes for MetaData Class

Attribute Value Description
DURATION_SESSION
Duration of a temporary table: session
DURATION_TRANS
Duration of a temporary table: transaction
DURATION_NULL
Duration of a temporary table: table not temporary
TYPEENCAP_PRIVATE
Encapsulation level of the method: private
TYPEENCAP_PUBLIC
Encapsulation level of the method: public
TYPEPARAM_IN
Argument mode: IN
TYPEPARAM_OUT
Argument mode: OUT
TYPEPARAM_INOUT
Argument mode: IN/OUT
CURSOR_OPEN
Effect of COMMIT operation on cursors and prepared statements in the database: preserve cursor state as before the COMMIT operation
CURSER_CLOSED
Effect of COMMIT operation on cursors and prepared statements in the database: cursors are closed on COMMIT, but the applicaton can still reexecute the statement without re-preparing it
CL_START
Position of the catalog in a qualified table: start
CL_END
Position of the catalog in a qualified table: end
SP_SUPPORTED
Database supports savepoints
SP_UNSUPPORTED
Database does not support savepoints
NW_SUPPORTED
Database supports nowait clause
NW_UNSUPPORTED
Database does not supports nowait clause
AC_DDL
Autocommit mode required for DDL statements
NO_AC_DDL
Autocommit mode not required for DDL statements
LOCK_IMMEDIATE
Locking mode for the database: immediate
LOCK_DELAYED
Locking mode for the database: delayed

Table 10-26 Summary of MetaData Methods

Method Description
MetaData()
MetaData class constructor.
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.
getUString()
Return the value of the attribute as a UString in the character set associated with the metadata.
getVector()
Gets the value of the attribute as an C++ vector.
operator=()
Assigns one metadata object to another.


MetaData()

MetaData class constructor.


Syntax
MetaData(
   const MetaData &omd);
Parameter Description
cmd
The source that the MetaData object will be copied from.


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;
Parameter Description
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;
Parameter Description
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 attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
The attribute ID


getRef()

This method returns the value of the attribute as a RefAny, or Ref to a TDO. If the value is SQL NULL, the result is NULL.


Syntax
RefAny getRef(
   MetaData::AttrId attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
The attribute ID


getUString()

Return the value of an attribute as a UString in the character set associated with the metadata.


Syntax
UString getUString(
   MetaData::AttrId attributeId) const;
Parameter Description
attributeId
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 attributeId) const;
Parameter Description
attributeId
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);
Parameter Description
cmd
MetaData object to be assigned