Oracle® C++ Call Interface Programmer's Guide 10g Release 2 (10.2) Part Number B14294-01 |
|
|
View PDF |
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 enumerated values of MetaData are in Table 12-26, and the summary of its methods is in Table 12-27.
Table 12-26 Enumerated Values Used by MetaData Class
Attribute | Options |
---|---|
ParamType |
The parameter types for objects are:
|
AttrId common to all parameters |
Attributes of all parameters:
|
AttrId for Tables and Views |
Parameters for a table or view (ParamType of PTYPE_TABLE and PTYPE_VIEW) have the following type-specific attributes:
|
AttrId for Tables only |
Parameters for a tables only (ParamType of PTYPE_TABLE):
|
AttrId for Functions and Procedures |
Parameters for functions and procedures (ParamType of PTYPE_FUNC and PTYPE_PROC, respectively):
|
AttrId for Packages |
Parameters for packages (ParamType of PTYPE_PKG):
|
AttrId for Types |
Parameter is for types (ParamType of PTYPE_TYPE):
|
AttrId for Type Attributes |
Parameter is for attributes of types (ParamType of PTYPE_TYPE_ATTR):
|
AttrId for Type Methods |
Parameter is for methods of types (ParamType of PTYPE_TYPE_METHOD):
|
AttrId for Collections |
Parameter is for collections (ParamType of PTYPE_TYPE_COLL):
|
AttrId for Synonyms |
Parameter is for synonyms (ParamType of PTYPE_SYN):
|
AttrId for Sequences |
Parameter is for sequences (ParamType of PTYPE_SEQ):
|
AttrId for Columns |
Parameter is for columns of tables or views (ParamType of PTYPE_COL):
|
AttrId for Arguments and Results |
Parameter for arguments of a procedure or function (PTYPE_ARG), a method (PTYPE_TYPE_ARG), or a result (PTYPE_TYPE_RESULT)
|
AttrId for Schemas |
Parameter is for schemas (ParamType of PTYPE_SCHEMA):
|
AttrId for Lists |
Parameter is for list of columns, arguments or subprograms:
|
AttrId for Databases |
Parameter is for list of columns, arguments or subprograms (ParamType of PTYPE_DATABASE):
|
AttrValues |
Attribute values are returned on executing a get xxx () method and passing in an attribute, for which these are the results:
|
Table 12-27 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() |
Returns 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
class constructor.
Syntax
MetaData( const MetaData &omd);
Parameter | Description |
---|---|
cmd |
The source that the MetaData object will be copied from. |
This method returns the number of attributes related to the metadata object.
Syntax
unsigned int getAttributeCount() const;
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. |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Returns 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 |
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 |
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 |