MetaDate类¶
元数据对象可用于描述ResultSet或数据库中现有模式对象中的列的类型和属性。它还提供了整个数据库的信息。
MetaData()¶
元数据类构造函数。(UString为字符集支持)
| 参数 | 描述 |
|---|---|
MetaData( const MetaData &omd |
源元数据对象 |
MetaData( const Connection * sessp const string& objName ParamType prmtyp |
Connection句柄 要获取元数据的字符串 要获取元数据字符串对应的type |
MetaData( const Connection * sessp const UString& objName ParamType prmtyp |
Connection句柄 要获取元数据的字符串 要获取元数据字符串对应的type |
MetaData( const Connection * sessp MetaDataImpl * implPtr ACIParam* parm |
Connection句柄 MetaDataImpl指针 ACIParam指针 |
getAttributeId()¶
返回指定的属性号所表示的属性的属性ID,例如ATTR_NUM_COLS。
语法
AttrId getAttributeId(
unsigned int attributeNum) const;
| 参数 | 描述 |
|---|---|
| attributeNum | 要为其返回属性ID的属性号。 |
getAttributeType()¶
此方法返回指定的属性号所表示的属性的属性类型,例如NUMBER或INT。
语法
Type getAttributeType(
unsigned int attributeNum) const;
| 参数 | 描述 |
|---|---|
| attributeNum | 要为其返回属性类型的属性号。 |
getInt()¶
以c++ int的形式返回属性的值,如果值为SQL NULL,则结果为0。
语法
MetaData getMetaData(
MetaData::AttrId attributeId) const;
| 参数 | 描述 |
|---|---|
| attributeId | 属性ID |
getString()¶
以字符串的形式返回属性的值。如果值为SQL NULL,则结果为NULL。
语法
string getString(
MetaData::AttrId attributeId) const;
| 参数 | 描述 |
|---|---|
| attributeId | 属性ID |
getUString()¶
以字符串的形式返回属性的值。如果值为SQL NULL,则结果为NULL。(UString为字符集支持)
语法
string getUString(
MetaData::AttrId attributeId) const;
| 参数 | 描述 |
|---|---|
| attributeId | 属性ID |
getUInt()¶
以c++ unsigned int的形式返回属性的值。如果值是SQL NULL,则结果为0。
语法
unsigned int getUInt(
MetaData::AttrId attributeId) const;
| 参数 | 描述 |
|---|---|
| attributeId | 属性ID |
getVector()¶
返回一个包含属性值的c++ vector。
语法
vector<MetaData> getVector(
MetaData::AttrId attributeId) const;
| 参数 | 描述 |
|---|---|
| attributeId | 属性ID |