2014-07-10 47 views
0

如何才能实现查询执行结果 - select count (*) from myTable? 的代码是:Oracle OCCI'选择计数(*)'结果提取

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

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

我怎样才能获得行计数的res价值?

+0

这感觉就像是你应该能够从他们的文档弄清楚...你尝试一些具体的和有问题? (此外,您可能希望在“s”中使用该查询)。 – BoBTFish

+0

在源代码中您的选择查询的周围有引号吗? –

+0

Found?! - res-> next(); int nCount = res-> getInt(1); – idanuda

回答

1

只要写

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

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