With the following code I always got that value on Oracle databases
SQLHSTMT hStmt = SQL_NULL_HANDLE;
SQLRETURN sret;
SQLLEN rowCount = 0;
const SQLHDBC conn = this->getConnection();
if (conn == NULL)
{
ret = false;
}
SQLAllocHandle(SQL_HANDLE_STMT, conn, &hStmt);
std::string metaTableName="meta_table";
sret=SQLTables( hStmt,
NULL, 0, /* no specific catalog */
NULL, 0, /* no specific schema */
(SQLCHAR *)metaTableName.c_str(), SQL_NTS,
NULL, 0); /* no specific type - table or view */
if ((sret != SQL_SUCCESS) && (sret != SQL_SUCCESS_WITH_INFO))
{
std::cout << "Problem retrieving " << metaTableName << " table from database!" << std::endl);
ret= false;
}
SQLRowCount(hStmt,&rowCount);
std::cout <<std::endl << "Rows: " <<rowCount<<std::endl ;
No error messages so no apparent cause of this behaviour
Using oracle libs: oracle-instantclient11.2-odbc-11.2.0.1.0-1.x86_64
Any ideas about the reasons of such a behaviour?