请参考:Resultset的getColumnListMetaData方法 The number, types and properties of a ResultSet’s columns are provided by the getMetaData method. Returns the description of a ResultSet’s columns. This method will return the value of the given column as a PObject. The type of the C++ object will be the C++ PObject type corresponding to the column’s SQL type registered with Environment’s map. This method is used to materialize data of SQL user-defined types. vector <MetaData> getColumnListMetaData() const;
通过句柄类型、读取的属性名、属性类型,可以获取到。
sword OCIAttrGet(
dvoid *trgthndlp, //需读取的句柄名
ub4 trghndltyp, //句柄类型
dvoid *attributep, //读取的属性名
ub4 *sizep, //属性值长度
ub4 attrtype, //属性类型
OCIError *errhp //错误句柄
) 具体的代码,我试试看看。等。
The number, types and properties of a ResultSet’s columns are provided by the
getMetaData method. Returns the description of a ResultSet’s columns. This
method will return the value of the given column as a PObject. The type of the
C++ object will be the C++ PObject type corresponding to the column’s SQL type
registered with Environment’s map. This method is used to materialize data of
SQL user-defined types.
vector <MetaData> getColumnListMetaData() const;
语句句柄=OCI_HTYPE_STMT, 属性类型=OCI_ATTR_PARAM_COUNT
OCIAttrGet(smuhp,OCI_HTYPE_STMT,(dvoid *) &numcols,(ub4*)0,
(ub4)OCI_ATTR_PARAM_COUNT,errhp);
(2)返回结果集中的行数
语句句柄=OCI_HTYPE_STMT, 属性类型=OCI_ATTR_ROW_COUNT
OCIAttrGet(stmhp,OCI_HTYPE_STMT,(dvoid*) &rOWS,0,
(ub4) OCI_ATTR_ROW_COUNT,errhp);