23 #include "ocilibcpp/types.hpp"
52 AcquireAllocatedWithNotification
55 connection.GetHandle(),
62 AcquireTransient(stmt, parent);
104 return Fetch(callback);
107 template<
class T,
class U>
112 return Fetch(callback, adapter);
127 return Fetch(callback);
130 template<
class T,
class U>
135 return Fetch(callback, adapter);
139 unsigned int Statement::Fetch(T callback)
141 unsigned int res = 0;
154 template<
class T,
class U>
155 unsigned int Statement::Fetch(T callback, U adapter)
157 unsigned int res = 0;
163 res += rs.ForEach(callback, adapter);
235 template<
typename M,
class T>
239 SetLastBindMode(mode);
242 template<
typename M,
class T>
245 core::Check(method(*
this, name.c_str(),
static_cast<typename support::BindResolver<T>::OutputType
>(value)));
246 SetLastBindMode(mode);
249 template<
typename M,
class T>
252 support::BindArray * bnd = core::OnAllocate(
new support::BindArray(*
this, name, mode));
253 bnd->SetVector<T>(values, type ==
BindInfo::AsPlSqlTable,
sizeof(
typename support::BindResolver<T>::OutputType));
255 const boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), bnd->GetSizeForBindCall());
259 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
260 bindsHolder->AddBindObject(bnd);
261 SetLastBindMode(mode);
265 delete core::OnDeallocate(bnd);
271 template<
typename M,
class T,
class U>
274 support::BindArray * bnd = core::OnAllocate(
new support::BindArray(*
this, name, mode));
275 bnd->SetVector<T>(values, type ==
BindInfo::AsPlSqlTable,
sizeof(
typename support::BindResolver<T>::OutputType));
277 const boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), subType, bnd->GetSizeForBindCall());
281 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
282 bindsHolder->AddBindObject(bnd);
283 SetLastBindMode(mode);
287 delete core::OnDeallocate(bnd);
296 support::BindTypeAdaptor<bool> * bnd = core::OnAllocate(
new support::BindTypeAdaptor<bool>(*
this, name, mode, value));
298 const boolean res =
OCI_BindBoolean(*
this, name.c_str(),
static_cast<boolean *
>(*bnd));
302 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
303 bindsHolder->AddBindObject(bnd);
304 SetLastBindMode(mode);
308 delete core::OnDeallocate(bnd);
432 SetLastBindMode(mode);
438 Bind<Clong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
445 SetLastBindMode(mode);
451 Bind<Blong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
459 maxSize =
static_cast<unsigned int>(value.size());
462 value.reserve(maxSize);
464 support::BindObjectAdaptor<ostring> * bnd = core::OnAllocate(
new support::BindObjectAdaptor<ostring>(*
this, name, mode, value, maxSize + 1));
466 const boolean res =
OCI_BindString(*
this, name.c_str(),
static_cast<otext *
>(*bnd), maxSize);
470 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
471 bindsHolder->AddBindObject(bnd);
472 SetLastBindMode(mode);
476 delete core::OnDeallocate(bnd);
485 Bind<ostring, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
493 maxSize =
static_cast<unsigned int>(value.size());
496 value.reserve(maxSize);
498 support::BindObjectAdaptor<Raw> * bnd = core::OnAllocate(
new support::BindObjectAdaptor<Raw>(*
this, name, mode, value, maxSize));
500 const boolean res =
OCI_BindRaw(*
this, name.c_str(),
static_cast<unsigned char *
>(*bnd), maxSize);
504 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
505 bindsHolder->AddBindObject(bnd);
506 SetLastBindMode(mode);
510 delete core::OnDeallocate(bnd);
519 Bind<Raw, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
586 SetLastBindMode(mode);
598 Bind<Timestamp, Timestamp::TimestampTypeValues>(name, values, subType.GetValue(), mode, type);
610 Bind<Interval, Interval::IntervalTypeValues>(name, values, subType.GetValue(), mode, type);
616 BindVector2(
OCI_BindArrayOfLobs, name, values, mode,
static_cast<unsigned int>(OCI_CLOB), type);
622 BindVector2(
OCI_BindArrayOfLobs, name, values, mode,
static_cast<unsigned int>(OCI_NCLOB), type);
628 BindVector2(
OCI_BindArrayOfLobs, name, values, mode,
static_cast<unsigned int>(OCI_BLOB), type);
634 BindVector2(
OCI_BindArrayOfFiles, name, values, mode,
static_cast<unsigned int>(OCI_BFILE), type);
666 bindsHolder->AddBindObject(bnd);
667 SetLastBindMode(mode);
671 delete core::OnDeallocate(bnd);
680 Bind<ostring, unsigned int>(name, values,
static_cast<unsigned int>(maxSize), mode, type);
686 support::BindArray * bnd = core::OnAllocate(
new support::BindArray(*
this, name, mode));
689 const boolean res =
OCI_BindArrayOfRaws(*
this, name.c_str(), bnd->GetData<
Raw>(), maxSize, bnd->GetSizeForBindCall());
693 support::BindsHolder *bindsHolder = GetBindsHolder(
true);
694 bindsHolder->AddBindObject(bnd);
695 SetLastBindMode(mode);
699 delete core::OnDeallocate(bnd);
712 inline void Statement::Register<unsigned short>(
const ostring& name)
718 inline void Statement::Register<short>(
const ostring& name)
724 inline void Statement::Register<unsigned int>(
const ostring& name)
730 inline void Statement::Register<int>(
const ostring& name)
736 inline void Statement::Register<big_uint>(
const ostring& name)
742 inline void Statement::Register<big_int>(
const ostring& name)
748 inline void Statement::Register<float>(
const ostring& name)
754 inline void Statement::Register<double>(
const ostring& name)
760 inline void Statement::Register<Number>(
const ostring& name)
766 inline void Statement::Register<Date>(
const ostring& name)
780 Register<Timestamp, Timestamp::TimestampTypeValues>(name, type.GetValue());
792 Register<Interval, Interval::IntervalTypeValues>(name, type.GetValue());
796 inline void Statement::Register<Clob>(
const ostring& name)
802 inline void Statement::Register<NClob>(
const ostring& name)
808 inline void Statement::Register<Blob>(
const ostring& name)
814 inline void Statement::Register<File>(
const ostring& name)
820 inline void Statement::Register<Object, TypeInfo>(
const ostring& name, TypeInfo& typeInfo)
826 inline void Statement::Register<Reference, TypeInfo>(
const ostring& name, TypeInfo& typeInfo)
832 inline void Statement::Register<ostring, unsigned int>(
const ostring& name,
unsigned int len)
838 inline void Statement::Register<ostring, int>(
const ostring& name,
int len)
840 Register<ostring, unsigned int>(name,
static_cast<unsigned int>(len));
844 inline void Statement::Register<Raw, unsigned int>(
const ostring& name,
unsigned int len)
850 inline void Statement::Register<Raw, int>(
const ostring& name,
int len)
852 Register<Raw, unsigned int>(name,
static_cast<unsigned int>(len));
959 inline void Statement::ClearBinds()
const
965 bindsHolder->Clear();
969 inline void Statement::SetOutData()
const
971 support::BindsHolder *bindsHolder = GetBindsHolder(
false);
975 bindsHolder->SetOutData();
979 inline void Statement::SetInData()
const
981 support::BindsHolder *bindsHolder = GetBindsHolder(
false);
985 bindsHolder->SetInData();
989 inline void Statement::ReleaseResultsets()
const
993 core::Handle *handle =
nullptr;
995 while (_smartHandle->GetChildren().FindIf(IsResultsetHandle, handle))
999 handle->DetachFromHolders();
1001 delete core::OnDeallocate(handle);
1009 inline bool Statement::IsResultsetHandle(core::Handle *handle)
1011 Resultset::SmartHandle *smartHandle =
dynamic_cast<Resultset::SmartHandle *
>(handle);
1013 return smartHandle !=
nullptr;
1016 inline void Statement::OnFreeSmartHandle(SmartHandle *smartHandle)
1020 support::BindsHolder *bindsHolder =
static_cast<support::BindsHolder *
>(smartHandle->GetExtraInfos());
1022 smartHandle->SetExtraInfos(
nullptr);
1024 delete core::OnDeallocate(bindsHolder);
1033 inline support::BindsHolder * Statement::GetBindsHolder(
bool create)
const
1035 support::BindsHolder * bindsHolder =
static_cast<support::BindsHolder *
>(_smartHandle->GetExtraInfos());
1037 if (bindsHolder ==
nullptr && create)
1039 bindsHolder = core::OnAllocate(
new support::BindsHolder(*
this));
1040 _smartHandle->SetExtraInfos(bindsHolder);
Provides SQL bind information.
core::Enum< VectorTypeValues > VectorType
Vector type.
core::Enum< BindDirectionValues > BindDirection
Bind direction.
Object identifying the SQL data types VARRAY and NESTED TABLE.
A connection or session with a specific database.
Exception class handling all OCILIB errors.
IntervalTypeValues
Interval types enumerated values.
core::Enum< IntervalTypeValues > IntervalType
Interval types.
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
void SetBindMode(BindMode value)
Set the binding mode of a SQL statement.
Statement()
Create an empty null Statement instance.
core::Enum< BindModeValues > BindMode
Bind Modes.
void SetPrefetchMemory(unsigned int value)
Set the amount of memory pre-fetched by OCI Client.
unsigned int GetFetchSize() const
Return the number of rows fetched per internal server fetch call.
BindMode GetBindMode() const
Return the binding mode of a SQL statement.
ostring GetSqlIdentifier() const
Return the server SQL_ID of the last SQL or PL/SQL statement prepared or executed by the statement.
void Bind(const ostring &name, T &value, BindInfo::BindDirection mode)
Bind an host variable.
void SetFetchSize(unsigned int value)
Set the number of rows fetched per internal server fetch call.
unsigned int GetSQLCommand() const
Return the Oracle SQL code the command held by the statement.
void AllowRebinding(bool value)
Allow different host variables to be binded using the same bind name or position between executions o...
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
BindInfo GetBind(unsigned int index) const
Return the bind at the given index in the internal array of bind objects.
ostring GetSql() const
Return the last SQL or PL/SQL statement prepared or executed by the statement.
void GetBatchErrors(std::vector< Exception > &exceptions)
Returns all errors that occurred within a DML array statement execution.
Connection GetConnection() const
Return the connection associated with a statement.
void SetBindArraySize(unsigned int size)
Set the input array size for bulk operations.
Resultset GetResultset()
Retrieve the resultset from an executed statement.
unsigned int GetPrefetchSize() const
Return the number of rows pre-fetched by OCI Client.
void Prepare(const ostring &sql)
Prepare a SQL statement or PL/SQL block.
unsigned int GetLongMaxSize() const
Return the LONG data type piece buffer size.
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
void Parse(const ostring &sql)
Parse a SQL statement or PL/SQL block.
void SetLongMode(LongMode value)
Set the long data type handling mode of a SQL statement.
unsigned int GetBindArraySize() const
Return the current input array size for bulk operations.
ostring GetSQLVerb() const
Return the verb of the SQL command held by the statement.
core::Enum< LongModeValues > LongMode
LONG data type mapping modes.
unsigned int GetBindCount() const
Return the number of binds currently associated to a statement.
core::Enum< StatementTypeValues > StatementType
Statement Type.
unsigned int GetBindIndex(const ostring &name) const
Return the index of the bind from its name belonging to the statement.
LongMode GetLongMode() const
Return the long data type handling mode of a SQL statement.
unsigned int GetPrefetchMemory() const
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
void Describe(const ostring &sql)
Describe the select list of a SQL select statement.
unsigned int GetAffectedRows() const
Return the number of rows affected by the SQL statement.
void ExecutePrepared()
Execute a prepared SQL statement or PL/SQL block.
unsigned int GetSqlErrorPos() const
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
FetchMode GetFetchMode() const
Return the fetch mode of a SQL statement.
void SetLongMaxSize(unsigned int value)
Set the LONG data type piece buffer size.
void SetFetchMode(FetchMode value)
Set the fetch mode of a SQL statement.
Resultset GetNextResultset()
Retrieve the next available resultset.
bool IsRebindingAllowed() const
Indicate if rebinding is allowed on the statement.
StatementType GetStatementType() const
Return the type of a SQL statement.
void SetPrefetchSize(unsigned int value)
Set the number of rows pre-fetched by OCI Client.
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
TimestampTypeValues
Interval types enumerated values.
Provides type information on Oracle Database objects.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Internal usage. Interface for handling ownership and relationship of a C API handle.
Internal usage. Class implementing bind translations between C++ vectors and C API arrays.
Internal usage. Class owning bind objects allowing to set/get C data prior/after a statement executio...
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfFloats(OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
Bind an array of floats.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindBigInt(OCI_Statement *stmt, const otext *name, big_int *data)
Bind a big integer variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_IsRebindingAllowed(OCI_Statement *stmt)
Indicate if rebinding is allowed on the given statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindFloat(OCI_Statement *stmt, const otext *name, float *data)
Bind a float variable.
OCI_SYM_PUBLIC OCI_Bind *OCI_API OCI_GetBind(OCI_Statement *stmt, unsigned int index)
Return the bind handle at the given index in the internal array of bind handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindString(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
Bind a string variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindObject(OCI_Statement *stmt, const otext *name, OCI_Object *data)
Bind an object (named type) variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindLob(OCI_Statement *stmt, const otext *name, OCI_Lob *data)
Bind a Lob variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfFiles(OCI_Statement *stmt, const otext *name, OCI_File **data, unsigned int type, unsigned int nbelem)
Bind an array of File handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_AllowRebinding(OCI_Statement *stmt, boolean value)
Allow different host variables to be binded using the same bind name or position between executions o...
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfRaws(OCI_Statement *stmt, const otext *name, void *data, unsigned int len, unsigned int nbelem)
Bind an array of raw buffers.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindFile(OCI_Statement *stmt, const otext *name, OCI_File *data)
Bind a File variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindBoolean(OCI_Statement *stmt, const otext *name, boolean *data)
Bind a boolean variable (PL/SQL ONLY)
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedInts(OCI_Statement *stmt, const otext *name, unsigned int *data, unsigned int nbelem)
Bind an array of unsigned integers.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfDoubles(OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
Bind an array of doubles.
OCI_SYM_PUBLIC OCI_Bind *OCI_API OCI_GetBind2(OCI_Statement *stmt, const otext *name)
Return a bind handle from its name.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindRaw(OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
Bind a raw buffer.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfIntervals(OCI_Statement *stmt, const otext *name, OCI_Interval **data, unsigned int type, unsigned int nbelem)
Bind an array of interval handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfBigInts(OCI_Statement *stmt, const otext *name, big_int *data, unsigned int nbelem)
Bind an array of big integers.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfLobs(OCI_Statement *stmt, const otext *name, OCI_Lob **data, unsigned int type, unsigned int nbelem)
Bind an array of Lob handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfInts(OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
Bind an array of integers.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedShorts(OCI_Statement *stmt, const otext *name, unsigned short *data, unsigned int nbelem)
Bind an array of unsigned shorts.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedBigInts(OCI_Statement *stmt, const otext *name, big_uint *data, unsigned int nbelem)
Bind an array of unsigned big integers.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindInterval(OCI_Statement *stmt, const otext *name, OCI_Interval *data)
Bind an interval variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfObjects(OCI_Statement *stmt, const otext *name, OCI_Object **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of object handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindRef(OCI_Statement *stmt, const otext *name, OCI_Ref *data)
Bind a Ref variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindInt(OCI_Statement *stmt, const otext *name, int *data)
Bind an integer variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindLong(OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
Bind a Long variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfTimestamps(OCI_Statement *stmt, const otext *name, OCI_Timestamp **data, unsigned int type, unsigned int nbelem)
Bind an array of timestamp handles.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBindCount(OCI_Statement *stmt)
Return the number of binds currently associated to a statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDirection(OCI_Bind *bnd, unsigned int direction)
Set the direction mode of a bind handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfDates(OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
Bind an array of dates.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfRefs(OCI_Statement *stmt, const otext *name, OCI_Ref **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Ref handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfStrings(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len, unsigned int nbelem)
Bind an array of strings.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindDate(OCI_Statement *stmt, const otext *name, OCI_Date *data)
Bind a date variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedShort(OCI_Statement *stmt, const otext *name, unsigned short *data)
Bind an unsigned short variable.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindArrayGetSize(OCI_Statement *stmt)
Return the current input array size for bulk operations.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfColls(OCI_Statement *stmt, const otext *name, OCI_Coll **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Collection handles.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindShort(OCI_Statement *stmt, const otext *name, short *data)
Bind an short variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArraySetSize(OCI_Statement *stmt, unsigned int size)
Set the input array size for bulk operations.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindColl(OCI_Statement *stmt, const otext *name, OCI_Coll *data)
Bind a Collection variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedInt(OCI_Statement *stmt, const otext *name, unsigned int *data)
Bind an unsigned integer variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindTimestamp(OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
Bind a timestamp variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindStatement(OCI_Statement *stmt, const otext *name, OCI_Statement *data)
Bind a Statement variable (PL/SQL Ref Cursor)
OCI_SYM_PUBLIC boolean OCI_API OCI_BindDouble(OCI_Statement *stmt, const otext *name, double *data)
Bind a double variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfShorts(OCI_Statement *stmt, const otext *name, short *data, unsigned int nbelem)
Bind an array of shorts.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBindIndex(OCI_Statement *stmt, const otext *name)
Return the index of the bind from its name belonging to the given statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedBigInt(OCI_Statement *stmt, const otext *name, big_uint *data)
Bind an unsigned big integer variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfNumbers(OCI_Statement *stmt, const otext *name, OCI_Number **data, unsigned int nbelem)
Bind an array of Number.
OCI_SYM_PUBLIC OCI_Error *OCI_API OCI_GetBatchError(OCI_Statement *stmt)
Returns the first or next error that occurred within a DML array statement execution.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindNumber(OCI_Statement *stmt, const otext *name, OCI_Number *data)
Bind an Number variable.
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers....
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterLob(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a lob output bind placeholder.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetNextResultset(OCI_Statement *stmt)
Retrieve the next available resultset.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterInt(OCI_Statement *stmt, const otext *name)
Register an integer output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterUnsignedInt(OCI_Statement *stmt, const otext *name)
Register an unsigned integer output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterDouble(OCI_Statement *stmt, const otext *name)
Register a double output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterInterval(OCI_Statement *stmt, const otext *name, unsigned int type)
Register an interval output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterTimestamp(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a timestamp output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterShort(OCI_Statement *stmt, const otext *name)
Register a short output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterRef(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register a Ref output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterUnsignedBigInt(OCI_Statement *stmt, const otext *name)
Register an unsigned big integer output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterUnsignedShort(OCI_Statement *stmt, const otext *name)
Register an unsigned short output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterDate(OCI_Statement *stmt, const otext *name)
Register a date output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterBigInt(OCI_Statement *stmt, const otext *name)
Register a big integer output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterString(OCI_Statement *stmt, const otext *name, unsigned int len)
Register a string output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterRaw(OCI_Statement *stmt, const otext *name, unsigned int len)
Register an raw output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterNumber(OCI_Statement *stmt, const otext *name)
Register a register output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterFile(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a file output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterFloat(OCI_Statement *stmt, const otext *name)
Register a float output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterObject(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register an object output bind placeholder.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetPrefetchSize(OCI_Statement *stmt)
Return the number of rows pre-fetched by OCI Client.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetPrefetchMemory(OCI_Statement *stmt, unsigned int size)
Set the amount of memory pre-fetched by OCI Client.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetFetchMode(OCI_Statement *stmt, unsigned int mode)
Set the fetch mode of a SQL statement.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_StatementGetConnection(OCI_Statement *stmt)
Return the connection handle associated with a statement handle.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetPrefetchMemory(OCI_Statement *stmt)
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetLongMaxSize(OCI_Statement *stmt)
Return the LONG data type piece buffer size.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBindMode(OCI_Statement *stmt)
Return the binding mode of a SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetLongMaxSize(OCI_Statement *stmt, unsigned int size)
Set the LONG data type piece buffer size.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetFetchMode(OCI_Statement *stmt)
Return the fetch mode of a SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetBindMode(OCI_Statement *stmt, unsigned int mode)
Set the binding mode of a SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetLongMode(OCI_Statement *stmt, unsigned int mode)
Set the long data type handling mode of a SQL statement.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetLongMode(OCI_Statement *stmt)
Return the long data type handling mode of a SQL statement.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetFetchSize(OCI_Statement *stmt)
Return the number of rows fetched per internal server fetch call.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetPrefetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows pre-fetched by OCI Client.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetFetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows fetched per internal server fetch call.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetStatementType(OCI_Statement *stmt)
Return the type of a SQL statement.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_Parse(OCI_Statement *stmt, const otext *sql)
Parse a SQL statement or PL/SQL block.
OCI_SYM_PUBLIC boolean OCI_API OCI_Describe(OCI_Statement *stmt, const otext *sql)
Describe the select list of a SQL select statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and Execute a SQL statement or PL/SQL block.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetSQLCommand(OCI_Statement *stmt)
Return the Oracle SQL code the command held by the statement handle.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSqlIdentifier(OCI_Statement *stmt)
Returns the statement SQL_ID from the server.
OCI_SYM_PUBLIC boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetSqlErrorPos(OCI_Statement *stmt)
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSql(OCI_Statement *stmt)
Return the last SQL or PL/SQL statement prepared or executed by the statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSQLVerb(OCI_Statement *stmt)
Return the verb of the SQL command held by the statement handle.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
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 )
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.