diff options
-rw-r--r-- | common/view/driver.cxx | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 2c5c65c..7ef8272 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -278,41 +278,40 @@ main (int argc, char* argv[]) // view1b // { - typedef odb::query<view1b> query; typedef odb::result<view1b> result; { - { - transaction t (db->begin ()); + transaction t (db->begin ()); - result r (db->query<view1b> ()); - view1_check (r); + result r (db->query<view1b> ()); + view1_check (r); - t.commit (); - } + t.commit (); + } - // No native parameter support in dynamic multi-database mode. - // + // No native parameter support in dynamic multi-database mode. + // #ifndef DATABASE_COMMON - { - transaction t (db->begin ()); + { + typedef odb::query<view1b> query; + + transaction t (db->begin ()); #ifndef DATABASE_ORACLE - result r (db->query<view1b> ("first = " + query::_val ("Jane"))); + result r (db->query<view1b> ("first = " + query::_val ("Jane"))); #else - result r (db->query<view1b> ("\"first\" = " + query::_val ("Jane"))); + result r (db->query<view1b> ("\"first\" = " + query::_val ("Jane"))); #endif - result::iterator i (r.begin ()); + result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe"); - assert (++i == r.end ()); + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe"); + assert (++i == r.end ()); - t.commit (); - } -#endif + t.commit (); } +#endif } // view1c |