如何使用MySQL C ++连接器检查值是否为NULL?

时间:2018-10-15 18:08:40

标签: c++ mysql mysql-connector

sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet  *res;
// ...
stmt = con->createStatement();
// ...

res = stmt->executeQuery("SELECT id, label FROM test ORDER BY id ASC");
while (res->next()) {
  cout << ", id= '" << res->getString("id") << "'" << endl;
}

delete res;
delete stmt;
delete con;

在上面的代码中,我想检查id是否具有任何NULL值?

0 个答案:

没有答案