aboutsummaryrefslogtreecommitdiff
path: root/odb/mssql/statement.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/mssql/statement.ixx')
-rw-r--r--odb/mssql/statement.ixx75
1 files changed, 45 insertions, 30 deletions
diff --git a/odb/mssql/statement.ixx b/odb/mssql/statement.ixx
index 89be46f..56e0ca4 100644
--- a/odb/mssql/statement.ixx
+++ b/odb/mssql/statement.ixx
@@ -6,44 +6,59 @@ namespace odb
{
namespace mssql
{
- inline unsigned long long insert_statement::
- version ()
+ inline bulk_statement::
+ bulk_statement (connection_type& c,
+ const std::string& text,
+ statement_kind k,
+ const binding* process,
+ bool optimize,
+ std::size_t batch,
+ std::size_t skip,
+ SQLUSMALLINT* status)
+ : statement (c, text, k, process, optimize),
+ status_ (batch == 1 ? 0 : status)
{
- unsigned long long r;
-
- // The value is in the big-endian format.
- //
- unsigned char* p (reinterpret_cast<unsigned char*> (&r));
- p[0] = version_[7];
- p[1] = version_[6];
- p[2] = version_[5];
- p[3] = version_[4];
- p[4] = version_[3];
- p[5] = version_[2];
- p[6] = version_[1];
- p[7] = version_[0];
+ if (status_ != 0 && !empty ())
+ init (skip);
+ }
- return r;
+ inline bulk_statement::
+ bulk_statement (connection_type& c,
+ const char* text,
+ statement_kind k,
+ const binding* process,
+ bool optimize,
+ std::size_t batch,
+ std::size_t skip,
+ SQLUSMALLINT* status,
+ bool copy_text)
+ : statement (c, text, k, process, optimize, copy_text),
+ status_ (batch == 1 ? 0 : status)
+ {
+ if (status_ != 0 && !empty ())
+ init (skip);
}
+ // update_statement
+ //
inline unsigned long long update_statement::
- version ()
+ result (std::size_t i)
{
- unsigned long long r;
+ if (i != i_)
+ mex_->current (++i_); // mex cannot be NULL since this is a batch.
- // The value is in the big-endian format.
- //
- unsigned char* p (reinterpret_cast<unsigned char*> (&r));
- p[0] = version_[7];
- p[1] = version_[6];
- p[2] = version_[5];
- p[3] = version_[4];
- p[4] = version_[3];
- p[5] = version_[2];
- p[6] = version_[1];
- p[7] = version_[0];
+ return result_;
+ }
+
+ // delete_statement
+ //
+ inline unsigned long long delete_statement::
+ result (std::size_t i)
+ {
+ if (i != i_)
+ mex_->current (++i_); // mex cannot be NULL since this is a batch.
- return r;
+ return result_;
}
}
}