Exemple #1
0
inline binding_string::binding_string(handles* hnd, size_t order, const std::string& str, ub1 cs_form) : m_str(brig::unicode::transform<char16_t>(str))
{
  const size_t size((m_str.size() + 1) * sizeof(char16_t));
  if (size > SHRT_MAX) throw std::runtime_error("OCI type error");
  m_ind = OCIInd(size);
  OCIBind* bnd(0);
  hnd->check(lib::singleton().p_OCIBindByPos(hnd->stmt, &bnd, hnd->err, ub4(order), (void*)m_str.c_str(), m_ind, SQLT_STR, &m_ind, 0, 0, 0, 0, OCI_DEFAULT));
  hnd->check(lib::singleton().p_OCIAttrSet(bnd, OCI_HTYPE_BIND, (void*)&cs_form, 0, OCI_ATTR_CHARSET_FORM, hnd->err));
} // binding_string::
Exemple #2
0
void binding_impl<T, TargetType>::bind(handles* hnd, size_t order)
{
  OCIBind* bnd(0);
  hnd->check(lib::singleton().p_OCIBindByPos(hnd->stmt, &bnd, hnd->err, ub4(order), &m_val, sizeof(m_val), TargetType, &m_ind, 0, 0, 0, 0, OCI_DEFAULT));
} // binding_impl::
Exemple #3
0
inline binding_blob::binding_blob(handles* hnd, size_t order, void* data, ub4 len) : m_data(data), m_len(len), m_ind(len > 0? OCI_IND_NOTNULL: OCI_IND_NULL)
{
  OCIBind* bnd(0);
  hnd->check(lib::singleton().p_OCIBindByPos(hnd->stmt, &bnd, hnd->err, ub4(order), 0, INT_MAX, SQLT_LBI, 0, 0, 0, 0, 0, OCI_DATA_AT_EXEC));
  hnd->check(lib::singleton().p_OCIBindDynamic(bnd, hnd->err, this, callback, 0, 0));
}
Exemple #4
0
define_impl<T, TargetType>::define_impl(handles* hnd, size_t order) : m_ind(OCI_IND_NULL)
{
  OCIDefine* def(0);
  hnd->check(lib::singleton().p_OCIDefineByPos(hnd->stmt, &def, hnd->err, ub4(order), &m_val, sizeof(m_val), TargetType, &m_ind, 0, 0, OCI_DEFAULT));
}