diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
commit | 0051807a6c28dd0ebb425d05511fbf9127483ee1 (patch) | |
tree | 0591323ddc132ff666d3edb0d2c9717a25437cba /odb/oracle/database.ixx | |
parent | 745e3ddf00303f6fed4e3962647c4eb11ee64816 (diff) |
Completion of prepared query support
Diffstat (limited to 'odb/oracle/database.ixx')
-rw-r--r-- | odb/oracle/database.ixx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/odb/oracle/database.ixx b/odb/oracle/database.ixx index 6d60d1e..38594a1 100644 --- a/odb/oracle/database.ixx +++ b/odb/oracle/database.ixx @@ -2,6 +2,8 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : ODB NCUEL; see accompanying LICENSE file +#include <odb/oracle/transaction.hxx> + namespace odb { namespace oracle @@ -393,5 +395,29 @@ namespace odb // return query_<T, id_oracle>::call (*this, q); } + + template <typename T> + inline prepared_query<T> database:: + prepare_query (const char* n, const char* q) + { + return prepare_query<T> (n, oracle::query<T> (q)); + } + + template <typename T> + inline prepared_query<T> database:: + prepare_query (const char* n, const std::string& q) + { + return prepare_query<T> (n, oracle::query<T> (q)); + } + + template <typename T> + inline prepared_query<T> database:: + prepare_query (const char* n, const oracle::query<T>& q) + { + // Throws if not in transaction. + // + oracle::connection& c (transaction::current ().connection ()); + return c.prepare_query (n, q); + } } } |