23 #include "ocilibcpp/support.hpp" 30 void BindObjectAdaptor<T>::SetInData()
32 if (GetMode() & OCI_BDM_IN)
34 size_t size = _object.size();
43 memcpy(_data, &_object[0], size *
sizeof(NativeType));
51 void BindObjectAdaptor<T>::SetOutData()
53 if (GetMode() & OCI_BDM_OUT)
58 _object.assign(_data, _data + size);
63 BindObjectAdaptor<T>::BindObjectAdaptor(
const ocilib::Statement& statement,
const ostring& name,
unsigned int mode, ObjectType&
object,
unsigned int size) :
64 BindObject(statement, name, mode),
66 _data(core::OnAllocate(new NativeType[size + 1], size + 1)),
69 memset(_data, 0, (_size + 1) *
sizeof(NativeType));
73 BindObjectAdaptor<T>::~BindObjectAdaptor() noexcept
75 delete core::OnDeallocate(_data);
79 BindObjectAdaptor<T>::operator NativeType* ()
const OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataSize(OCI_Bind *bnd)
Return the actual size of the element held by the given bind handle.
Object used for executing SQL or PL/SQL statement and returning the produced results.
OCI_SYM_PUBLIC OCI_Bind *OCI_API OCI_GetBind2(OCI_Statement *stmt, const otext *name)
Return a bind handle from its name.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
struct OCI_Bind OCI_Bind
Internal bind representation.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...