Oracle® C++ Call Interface Programmer's Guide 10g Release 1 (10.1) Part Number B10778-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 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 get
xxx
()
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
class constructor.
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.
unsigned int getAttributeCount() const;
This method returns the attribute ID (ATTR_NUM_COLS,
. . . ) of the attribute represented by the attribute number specified.
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.
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
.
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
.
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.
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
.
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
.
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
.
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
.
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
.
unsigned int getUInt( MetaData::AttrId attributeId) const;
Parameter | Description |
---|---|
attributeId |
The attribute ID |
Return the value of an attribute as a UString in the character set associated with the metadata.
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.
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.
void operator=( const MetaData &omd);
Parameter | Description |
---|---|
cmd |
MetaData object to be assigned |