Click here to Skip to main content
15,887,344 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In the following code, the intention is to check for null or empty result set , but I keep getting an excepton thrown.

C++
pstmt = con->prepareStatement("SELECT id FROM test ORDER BY id ASC");
  res = pstmt->executeQuery();
  res->next();
  if(res->isNull(1))
  {
	  cout << " In null";
  }
  else
  {
	  cout << " Is not Null";
  }


How does one test for null or empty result set?
Posted

1 solution

Try this:
if(res->next())

see documentation[^]
 
Share this answer
 
v2
Comments
Gbenbam 3-Sep-15 12:01pm    
Ok. Thanks. I'll try it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900