From 62e234c114d2b6ead93a1d39593c66b648c3d0a6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 1 Feb 2024 15:47:37 +0300 Subject: Turn libodb-oracle repository into package for muti-package repository --- libodb-oracle/odb/oracle/statement.ixx | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 libodb-oracle/odb/oracle/statement.ixx (limited to 'libodb-oracle/odb/oracle/statement.ixx') diff --git a/libodb-oracle/odb/oracle/statement.ixx b/libodb-oracle/odb/oracle/statement.ixx new file mode 100644 index 0000000..ef0fa64 --- /dev/null +++ b/libodb-oracle/odb/oracle/statement.ixx @@ -0,0 +1,62 @@ +// file : odb/oracle/statement.ixx +// license : ODB NCUEL; see accompanying LICENSE file + +using namespace std; + +namespace odb +{ + namespace oracle + { + // bulk_statement + // + inline bulk_statement:: + bulk_statement (connection_type& c, + const std::string& text, + statement_kind k, + const binding* process, + bool optimize, + std::size_t batch, + sb4* status) + : statement (c, text, k, process, optimize), + status_ (batch == 1 ? 0 : status) + { + } + + inline bulk_statement:: + bulk_statement (connection_type& c, + const char* text, + statement_kind k, + const binding* process, + bool optimize, + std::size_t batch, + sb4* status) + : statement (c, text, k, process, optimize), + status_ (batch == 1 ? 0 : status) + { + } + + // insert_statement + // + inline void insert_statement:: + fetch (sword r, sb4 code) + { + result_ = true; + + if (r != 0 /*OCI_SUCCESS*/) + { + // An auto-assigned object id should never cause a duplicate primary + // key. + // + if (ret_ == 0) + { + // The Oracle error code ORA-00001 indicates unique constraint + // violation, which covers more than just a duplicate primary key. + // Unfortunately, there is nothing more precise that we can use. + // + if (code == 1) + result_ = false; + } + } + } + } +} -- cgit v1.1