diff options
Diffstat (limited to 'view/driver.cxx')
-rw-r--r-- | view/driver.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/view/driver.cxx b/view/driver.cxx index 36274d6..cbe26ee 100644 --- a/view/driver.cxx +++ b/view/driver.cxx @@ -179,12 +179,14 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result<employee_count> r ( - db->query<employee_count> (query<employee_count>::last == "Doe")); - - // Result of this aggregate query contains only one element. + // Result of an aggregate query contains only one element so let's + // use the query_value() shortcut. // - cout << r.begin ()->count << " employees with the Doe last name" << endl + employee_count ec ( + db->query_value<employee_count> ( + query<employee_count>::last == "Doe")); + + cout << ec.count << " employees with the Doe last name" << endl << endl; t.commit (); |