简体   繁体   English

Oracle OCCI'选择计数(*)'获取结果

[英]Oracle OCCI 'select count(*)' result fetching

How can I get there results of the query execution - select count (*) from myTable ? 如何获得查询执行的结果- select count (*) from myTable The code is: 代码是:

... 
oc::Statement* stmt = 
    m_cConnection->createStatement(select count (*) from myTable);

oc::ResultSet* res = stmt->executeQuery();
...

How can I get the value of the row count in res ? 如何获取res中的行计数值?

Just write 写吧

cout << res->getString(1) << endl;

or 要么

cout << "\t... MySQL counts: " << res->getInt(1) << endl;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM