列数:select count(*) from user_tab_columns where table_name='atab' 类型:select column_name,data_type from user_tab_columns where table_name='atab'
谢谢各位大大,我的意思是我的查询是有选择的(例如用户输入),用这个输入打开一个查询结果集,例如'select a, b, c from atab',不通过分析语句,我怎样知道结果集列数和列名、类型等?就像我们用ado一样,打开一个Recordset是一个查询语句,只要语法正确,就可以通过GetColCount()得到我想要的东西。
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;
类型:select column_name,data_type from user_tab_columns where table_name='atab'
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;