[Cppcms-users] [cppdb] Get the count after select count(*)
Brought to you by:
artyom-beilis
From: Allan S. <all...@su...> - 2011-07-27 13:35:33
|
Hello, I want to retrieve the number of row in my table users, so I wrote the following getUsersCount = sqliteDb.create_prepared_statement( "SELECT count(*) as total FROM users " ); int total = getUsersCount.query().get<int>("total"); But I run it, i get the following exception "2011-07-27 13:20:41 GMT; cppcms, error: Caught exception [cppdb::null_value_fetch attempt fetch null column]" (which is different from the exception i get if i try to get the value of a column that does not exists at all) Am I doing something wrong ? Regards, Allan |