summaryrefslogtreecommitdiff
path: root/odb/oracle/query-dynamic.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-11-21 13:11:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-11-21 13:11:43 +0200
commitb3826d5ff054deeb7ba22aecb242cec2dca2f93a (patch)
tree7af4d7b2742db8c36dda3c97d12a2c40bf4b14b0 /odb/oracle/query-dynamic.ixx
parent83374c27062772de95ab12652713bfb2c218ba48 (diff)
Add dynamic multi-database query support
Diffstat (limited to 'odb/oracle/query-dynamic.ixx')
-rw-r--r--odb/oracle/query-dynamic.ixx73
1 files changed, 73 insertions, 0 deletions
diff --git a/odb/oracle/query-dynamic.ixx b/odb/oracle/query-dynamic.ixx
new file mode 100644
index 0000000..4554921
--- /dev/null
+++ b/odb/oracle/query-dynamic.ixx
@@ -0,0 +1,73 @@
+// file : odb/oracle/query-dynamic.ixx
+// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC
+// license : ODB NCUEL; see accompanying LICENSE file
+
+namespace odb
+{
+ namespace oracle
+ {
+ //
+ //
+ template <typename T, database_type_id ID>
+ inline query_column<T, ID>::
+ query_column (odb::query_column<T>& qc,
+ const char* table,
+ const char* column,
+ const char* conv,
+ unsigned short prec,
+ short scale)
+ : query_column_base (table, column, conv, prec, scale)
+ {
+ native_column_info& ci (qc.native_info[id_oracle]);
+ ci.column = static_cast<query_column_base*> (this);
+
+ // For some reason GCC needs this statically-typed pointer in
+ // order to instantiate the functions.
+ //
+ query_param_factory f (&query_param_factory_impl<T, ID>);
+ ci.param_factory = reinterpret_cast<void*> (f);
+ }
+
+ template <typename T>
+ inline query_column<T, id_blob>::
+ query_column (odb::query_column<T>& qc,
+ const char* table, const char* column, const char*)
+ : lob_query_column (table, column)
+ {
+ native_column_info& ci (qc.native_info[id_oracle]);
+ ci.column = static_cast<query_column_base*> (this);
+
+ // In Oracle LOBs cannot be compared.
+ //
+ ci.param_factory = 0;
+ }
+
+ template <typename T>
+ inline query_column<T, id_clob>::
+ query_column (odb::query_column<T>& qc,
+ const char* table, const char* column, const char*)
+ : lob_query_column (table, column)
+ {
+ native_column_info& ci (qc.native_info[id_oracle]);
+ ci.column = static_cast<query_column_base*> (this);
+
+ // In Oracle LOBs cannot be compared.
+ //
+ ci.param_factory = 0;
+ }
+
+ template <typename T>
+ inline query_column<T, id_nclob>::
+ query_column (odb::query_column<T>& qc,
+ const char* table, const char* column, const char*)
+ : lob_query_column (table, column)
+ {
+ native_column_info& ci (qc.native_info[id_oracle]);
+ ci.column = static_cast<query_column_base*> (this);
+
+ // In Oracle LOBs cannot be compared.
+ //
+ ci.param_factory = 0;
+ }
+ }
+}