diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-08-14 09:37:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-11 10:29:49 +0200 |
commit | 159c8b877add5c523b575aa3d3d34a4931b1266c (patch) | |
tree | 4883510f35f0a677d9739c1191f9f375c124b92c /odb/oracle/statement.hxx | |
parent | 0d695ddc84b574646b62c9be8ce45570ac3656c4 (diff) |
Draft implementation for INSERT
Diffstat (limited to 'odb/oracle/statement.hxx')
-rw-r--r-- | odb/oracle/statement.hxx | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/odb/oracle/statement.hxx b/odb/oracle/statement.hxx index cf336c4..93213d1 100644 --- a/odb/oracle/statement.hxx +++ b/odb/oracle/statement.hxx @@ -11,6 +11,7 @@ #include <cstddef> // std::size_t #include <odb/statement.hxx> +#include <odb/exceptions.hxx> #include <odb/oracle/version.hxx> #include <odb/oracle/forward.hxx> @@ -96,7 +97,8 @@ namespace odb // of columns bound. // ub4 - bind_param (bind*, std::size_t count); + bind_param (bind*, std::size_t count, + size_t batch = 1, std::size_t skip = 0); // Bind results for this statement. This function must only be // called once. Multiple calls to it will result in memory leaks @@ -261,27 +263,30 @@ namespace odb const std::string& text, bool process_text, binding& param, - bool returning); + binding* returning); insert_statement (connection_type& conn, const char* text, bool process_text, binding& param, - bool returning); + binding* returning); - // Return true if successful and false if the row is a duplicate. All - // other errors are reported by throwing exceptions. + // Return the number of rows (out of n) that were attempted. // - bool - execute (); + std::size_t + execute (std::size_t n = 1, multiple_exceptions* = 0); - unsigned long long - id (); + // Return true if successful and false if this row is a duplicate. + // All other errors are reported via exceptions. + // + bool + result (std::size_t i = 0); private: insert_statement (const insert_statement&); insert_statement& operator= (const insert_statement&); + /* // Only OCI versions 11.2 and greater support conversion of the internal // Oracle type NUMBER to an external 64-bit integer type. If we detect // version 11.2 or greater we provide an unsigned long long image. @@ -304,13 +309,25 @@ namespace odb sb2 indicator; }; + */ private: void - init (binding& param, bool returning); + init (binding& param); + + void + fetch (sword r, OCIError*); + + public: // For odb_oracle_returning_*(). + binding* ret_; + ub4 ret_size_; // You don't want to know (see statement.cxx). private: - id_bind_type id_bind_; + multiple_exceptions* mex_; + std::size_t n_; + std::size_t i_; + auto_handle<OCIError>* status_; + bool result_; }; class LIBODB_ORACLE_EXPORT update_statement: public statement |