aboutsummaryrefslogtreecommitdiff
path: root/common/query/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r--common/query/driver.cxx33
1 files changed, 23 insertions, 10 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index 1d19860..b94bed6 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -140,10 +140,11 @@ main (int argc, char* argv[])
cout << "test 003" << endl;
{
transaction t (db->begin ());
- result r (
- db->query<person> (query::age + " >= 30 AND " +
- query::last_name + " = 'Doe'"));
-
+#ifndef DATABASE_ORACLE
+ result r (db->query<person> ("age >= 30 AND last = 'Doe'"));
+#else
+ result r (db->query<person> ("\"age\" >= 30 AND \"last\" = 'Doe'"));
+#endif
print (r);
t.commit ();
}
@@ -156,9 +157,17 @@ main (int argc, char* argv[])
const char* name = "Doe";
+#ifndef DATABASE_ORACLE
result r (
- db->query<person> (query::age + " >= " + query::_ref (30) + "AND " +
- query::last_name + " = " + query::_val (name)));
+ db->query<person> (
+ "age >= " + query::_ref (30) + "AND" +
+ "last = " + query::_val (name)));
+#else
+ result r (
+ db->query<person> (
+ "\"age\" >= " + query::_ref (30) + "AND" +
+ "\"last\" = " + query::_val (name)));
+#endif
print (r);
t.commit ();
@@ -173,8 +182,13 @@ main (int argc, char* argv[])
string name;
unsigned short age;
- query q (query::age + " >= " + query::_ref (age) + "AND" +
- query::last_name + " = " + query::_ref (name));
+#ifndef DATABASE_ORACLE
+ query q ("age >= " + query::_ref (age) + "AND" +
+ "last = " + query::_ref (name));
+#else
+ query q ("\"age\" >= " + query::_ref (age) + "AND" +
+ "\"last\" = " + query::_ref (name));
+#endif
name = "Doe";
age = 30;
@@ -354,8 +368,7 @@ main (int argc, char* argv[])
// +
//
r = db->query<person> ((query::last_name == "Doe") +
- "ORDER BY" +
- query::age);
+ "ORDER BY" + query::age);
print (r);
t.commit ();