23 #include "ocilibcpp/types.hpp" 57 Acquire(stmt, reinterpret_cast<HandleFreeFunc>(parent ?
OCI_StatementFree :
nullptr), OnFreeSmartHandle, parent);
99 return Fetch(callback);
102 template<
class T,
class U>
107 return Fetch(callback, adapter);
122 return Fetch(callback);
125 template<
class T,
class U>
130 return Fetch(callback, adapter);
134 unsigned int Statement::Fetch(T callback)
136 unsigned int res = 0;
149 template<
class T,
class U>
150 unsigned int Statement::Fetch(T callback, U adapter)
152 unsigned int res = 0;
158 res += rs.
ForEach(callback, adapter);
230 template<
typename M,
class T>
234 SetLastBindMode(mode);
237 template<
typename M,
class T>
241 SetLastBindMode(mode);
244 template<
typename M,
class T>
250 const boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), bnd->GetSizeForBindCall());
255 bindsHolder->AddBindObject(bnd);
256 SetLastBindMode(mode);
260 delete core::OnDeallocate(bnd);
266 template<
typename M,
class T,
class U>
272 const boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), subType, bnd->GetSizeForBindCall());
277 bindsHolder->AddBindObject(bnd);
278 SetLastBindMode(mode);
282 delete core::OnDeallocate(bnd);
293 const boolean res =
OCI_BindBoolean(*
this, name.c_str(),
static_cast<boolean *
>(*bnd));
298 bindsHolder->AddBindObject(bnd);
299 SetLastBindMode(mode);
303 delete core::OnDeallocate(bnd);
427 SetLastBindMode(mode);
433 Bind<Clong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
440 SetLastBindMode(mode);
446 Bind<Blong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
454 maxSize =
static_cast<unsigned int>(value.size());
457 value.reserve(maxSize);
461 const boolean res =
OCI_BindString(*
this, name.c_str(),
static_cast<otext *
>(*bnd), maxSize);
466 bindsHolder->AddBindObject(bnd);
467 SetLastBindMode(mode);
471 delete core::OnDeallocate(bnd);
480 Bind<ostring, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
488 maxSize =
static_cast<unsigned int>(value.size());
491 value.reserve(maxSize);
495 const boolean res =
OCI_BindRaw(*
this, name.c_str(),
static_cast<unsigned char *
>(*bnd), maxSize);
500 bindsHolder->AddBindObject(bnd);
501 SetLastBindMode(mode);
505 delete core::OnDeallocate(bnd);
514 Bind<Raw, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
581 SetLastBindMode(mode);
593 Bind<Timestamp, Timestamp::TimestampTypeValues>(name, values, subType.GetValue(), mode, type);
605 Bind<Interval, Interval::IntervalTypeValues>(name, values, subType.GetValue(), mode, type);
611 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_CLOB), type);
617 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_NCLOB), type);
623 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_BLOB), type);
629 BindVector2(
OCI_BindArrayOfFiles, name, values, mode, static_cast<unsigned int>(OCI_BFILE), type);
641 BindVector2(
OCI_BindArrayOfRefs, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), type);
647 BindVector2(
OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), type);
661 bindsHolder->AddBindObject(bnd);
662 SetLastBindMode(mode);
666 delete core::OnDeallocate(bnd);
675 Bind<ostring, unsigned int>(name, values,
static_cast<unsigned int>(maxSize), mode, type);
684 const boolean res =
OCI_BindArrayOfRaws(*
this, name.c_str(), bnd->GetData<
Raw>(), maxSize, bnd->GetSizeForBindCall());
689 bindsHolder->AddBindObject(bnd);
690 SetLastBindMode(mode);
694 delete core::OnDeallocate(bnd);
703 BindVector2(
OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), GetArraysize(type, values));
707 inline void Statement::Register<unsigned short>(
const ostring& name)
713 inline void Statement::Register<short>(
const ostring& name)
719 inline void Statement::Register<unsigned int>(
const ostring& name)
725 inline void Statement::Register<int>(
const ostring& name)
731 inline void Statement::Register<big_uint>(
const ostring& name)
737 inline void Statement::Register<big_int>(
const ostring& name)
743 inline void Statement::Register<float>(
const ostring& name)
749 inline void Statement::Register<double>(
const ostring& name)
755 inline void Statement::Register<Number>(
const ostring& name)
761 inline void Statement::Register<Date>(
const ostring& name)
775 Register<Timestamp, Timestamp::TimestampTypeValues>(name, type.GetValue());
787 Register<Interval, Interval::IntervalTypeValues>(name, type.GetValue());
791 inline void Statement::Register<Clob>(
const ostring& name)
797 inline void Statement::Register<NClob>(
const ostring& name)
803 inline void Statement::Register<Blob>(
const ostring& name)
809 inline void Statement::Register<File>(
const ostring& name)
815 inline void Statement::Register<Object, TypeInfo>(
const ostring& name,
TypeInfo& typeInfo)
821 inline void Statement::Register<Reference, TypeInfo>(
const ostring& name,
TypeInfo& typeInfo)
827 inline void Statement::Register<ostring, unsigned int>(
const ostring& name,
unsigned int len)
833 inline void Statement::Register<ostring, int>(
const ostring& name,
int len)
835 Register<ostring, unsigned int>(name,
static_cast<unsigned int>(len));
839 inline void Statement::Register<Raw, unsigned int>(
const ostring& name,
unsigned int len)
845 inline void Statement::Register<Raw, int>(
const ostring& name,
int len)
847 Register<Raw, unsigned int>(name,
static_cast<unsigned int>(len));
954 inline void Statement::ClearBinds()
const 960 bindsHolder->Clear();
964 inline void Statement::SetOutData()
const 970 bindsHolder->SetOutData();
974 inline void Statement::SetInData()
const 980 bindsHolder->SetInData();
984 inline void Statement::ReleaseResultsets()
const 990 while (_smartHandle->GetChildren().FindIf(IsResultsetHandle, handle))
994 handle->DetachFromHolders();
996 delete core::OnDeallocate(handle);
1004 inline bool Statement::IsResultsetHandle(
core::Handle *handle)
1006 Resultset::SmartHandle *smartHandle =
dynamic_cast<Resultset::SmartHandle *
>(handle);
1008 return smartHandle !=
nullptr;
1011 inline void Statement::OnFreeSmartHandle(SmartHandle *smartHandle)
1017 smartHandle->SetExtraInfos(
nullptr);
1019 delete core::OnDeallocate(bindsHolder);
1032 if (bindsHolder ==
nullptr && create)
1035 _smartHandle->SetExtraInfos(bindsHolder);
unsigned int GetAffectedRows() const
Return the number of rows affected by the SQL statement.
unsigned int GetLongMaxSize() const
Return the LONG data type piece buffer size.
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_BindLong(OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
Bind a Long variable.
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers...
Internal usage. Interface for handling ownership and relationship of a C API handle.
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.
Internal usage. Class implementing bind adapters between C++ class and C API types.
void SetFetchSize(unsigned int value)
Set the number of rows fetched per internal server fetch call.
void SetFetchMode(FetchMode value)
Set the fetch mode of a SQL statement.
Exception class handling all OCILIB errors.
Provides SQL bind information.
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 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.
Resultset GetResultset()
Retrieve the resultset from an executed statement.
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_BindArrayOfDates(OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
Bind an array of dates.
void Describe(const ostring &sql)
Describe the select list of a SQL select statement.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSQLVerb(OCI_Statement *stmt)
Return the verb of the SQL command held by the statement handle.
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_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_RegisterRef(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register a Ref output bind placeholder.
StatementType GetStatementType() const
Return the type of a SQL statement.
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_BindArrayOfNumbers(OCI_Statement *stmt, const otext *name, OCI_Number **data, unsigned int nbelem)
Bind an array of Number.
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_IsRebindingAllowed(OCI_Statement *stmt)
Indicate if rebinding is allowed on the given statement.
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_AllowRebinding(OCI_Statement *stmt, boolean value)
Allow different host variables to be binded using the same bind name or position between executions o...
unsigned int GetBindIndex(const ostring &name) const
Return the index of the bind from its name belonging to the statement.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetStatementType(OCI_Statement *stmt)
Return the type of a SQL statement.
Object used for executing SQL or PL/SQL statement and returning the produced results.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetBindMode(OCI_Statement *stmt, unsigned int mode)
Set the binding mode of a SQL statement.
A connection or session with a specific database.
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 unsigned int OCI_API OCI_GetBindMode(OCI_Statement *stmt)
Return the binding mode of a SQL statement.
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_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_SetFetchMode(OCI_Statement *stmt, unsigned int mode)
Set the fetch mode of a SQL statement.
core::Enum< BindModeValues > BindMode
Bind Modes.
void SetBindMode(BindMode value)
Set the binding mode of a SQL statement.
Object identifying the SQL data type LONG.
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_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterUnsignedInt(OCI_Statement *stmt, const otext *name)
Register an unsigned integer output bind placeholder.
void ExecutePrepared()
Execute a prepared SQL statement or PL/SQL block.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfDoubles(OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
Bind an array of doubles.
TimestampTypeValues
Interval types enumerated values.
void Parse(const ostring &sql)
Parse a SQL statement or PL/SQL block.
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_BindString(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
Bind a string variable.
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_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_BindArrayOfFloats(OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
Bind an array of floats.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetPrefetchMemory(OCI_Statement *stmt, unsigned int size)
Set the amount of memory pre-fetched by OCI Client.
ostring GetSql() const
Return the last SQL or PL/SQL statement prepared or executed by the statement.
Connection GetConnection() const
Return the connection associated with a statement.
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.
void SetLongMaxSize(unsigned int value)
Set the LONG data type piece buffer size.
Internal usage. Class implementing bind translations between C++ vectors and C API arrays...
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_BindTimestamp(OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
Bind a timestamp variable.
Object identifying the SQL data type REF.
Internal usage. Allow resolving a native type used by C API from a C++ type in binding operations...
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
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 unsigned int OCI_API OCI_GetFetchMode(OCI_Statement *stmt)
Return the fetch mode of a SQL statement.
void SetPrefetchMemory(unsigned int value)
Set the amount of memory pre-fetched by OCI Client.
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_BindUnsignedInt(OCI_Statement *stmt, const otext *name, unsigned int *data)
Bind an unsigned integer variable.
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_RegisterNumber(OCI_Statement *stmt, const otext *name)
Register a register output bind placeholder.
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_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_GetBindCount(OCI_Statement *stmt)
Return the number of binds currently associated to a statement.
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
Internal usage. Class implementing bind adapters between C++ types and C API types when C++ types do ...
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_SetLongMode(OCI_Statement *stmt, unsigned int mode)
Set the long data type handling mode of a SQL statement.
void SetBindArraySize(unsigned int size)
Set the input array size for bulk operations.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
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.
unsigned int GetFetchSize() const
Return the number of rows fetched per internal server fetch call.
core::Enum< LongModeValues > LongMode
LONG data type mapping modes.
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 boolean OCI_API OCI_RegisterLob(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a lob output bind placeholder.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetSQLCommand(OCI_Statement *stmt)
Return the Oracle SQL code the command held by the statement handle.
Object identifying the SQL data type BFILE.
Object identifying the SQL data types VARRAY and NESTED TABLE.
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 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.
Object identifying the SQL data type INTERVAL.
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_BindUnsignedShort(OCI_Statement *stmt, const otext *name, unsigned short *data)
Bind an unsigned short variable.
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_SetLongMaxSize(OCI_Statement *stmt, unsigned int size)
Set the LONG data type piece buffer size.
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.
void AllowRebinding(bool value)
Allow different host variables to be binded using the same bind name or position between executions o...
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetFetchSize(OCI_Statement *stmt)
Return the number of rows fetched per internal server fetch call.
void GetBatchErrors(std::vector< Exception > &exceptions)
Returns all errors that occurred within a DML array statement execution.
unsigned int GetPrefetchMemory() const
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_SYM_PUBLIC boolean OCI_API OCI_RegisterBigInt(OCI_Statement *stmt, const otext *name)
Register a big integer output bind placeholder.
unsigned int GetBindCount() const
Return the number of binds currently associated to a 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_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
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_BindStatement(OCI_Statement *stmt, const otext *name, OCI_Statement *data)
Bind a Statement variable (PL/SQL Ref Cursor)
FetchMode GetFetchMode() const
Return the fetch mode of a SQL statement.
core::Enum< StatementTypeValues > StatementType
Statement Type.
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_BindDate(OCI_Statement *stmt, const otext *name, OCI_Date *data)
Bind a date variable.
BindInfo GetBind(unsigned int index) const
Return the bind at the given index in the internal array of bind objects.
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 unsigned int OCI_API OCI_BindArrayGetSize(OCI_Statement *stmt)
Return the current input array size for bulk operations.
unsigned int GetBindArraySize() const
Return the current input array size for bulk operations.
unsigned int GetSqlErrorPos() const
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
ostring GetSqlIdentifier() const
Return the server SQL_ID of the last SQL or PL/SQL statement prepared or executed by the statement...
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 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_RegisterShort(OCI_Statement *stmt, const otext *name)
Register a short 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.
bool IsRebindingAllowed() const
Indicate if rebinding is allowed on the statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindShort(OCI_Statement *stmt, const otext *name, short *data)
Bind an short variable.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetLongMaxSize(OCI_Statement *stmt)
Return the LONG data type piece buffer size.
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
void SetLongMode(LongMode value)
Set the long data type handling mode of a SQL statement.
void Prepare(const ostring &sql)
Prepare a SQL statement or PL/SQL block.
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 boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfInts(OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
Bind an array of integers.
Statement()
Create an empty null Statement instance.
Provides type information on Oracle Database objects.
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.
Object identifying the SQL data type NUMBER.
IntervalTypeValues
Interval types enumerated values.
void SetPrefetchSize(unsigned int value)
Set the number of rows pre-fetched by OCI Client.
Resultset GetNextResultset()
Retrieve the next available resultset.
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_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_RegisterDouble(OCI_Statement *stmt, const otext *name)
Register a double output bind placeholder.
ostring GetSQLVerb() const
Return the verb of the SQL command held by the statement.
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_BindColl(OCI_Statement *stmt, const otext *name, OCI_Coll *data)
Bind a Collection variable.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
OCI_SYM_PUBLIC boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDirection(OCI_Bind *bnd, unsigned int direction)
Set the direction mode of a bind handle.
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
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_BindBoolean(OCI_Statement *stmt, const otext *name, boolean *data)
Bind a boolean variable (PL/SQL ONLY)
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_BindArrayOfStrings(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len, unsigned int nbelem)
Bind an array of strings.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetNextResultset(OCI_Statement *stmt)
Retrieve the next available resultset.
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 ) ...
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_RegisterString(OCI_Statement *stmt, const otext *name, unsigned int len)
Register a string output bind placeholder.
OCI_SYM_PUBLIC boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
unsigned int GetPrefetchSize() const
Return the number of rows pre-fetched by OCI Client.
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_RegisterDate(OCI_Statement *stmt, const otext *name)
Register a date output bind placeholder.
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Object identifying the SQL data type TIMESTAMP.
unsigned int GetSQLCommand() const
Return the Oracle SQL code the command held by the 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 OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
void Bind(const ostring &name, T &value, BindInfo::BindDirection mode)
Bind an host variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindFile(OCI_Statement *stmt, const otext *name, OCI_File *data)
Bind a File variable.
Object identifying the SQL data type OBJECT.
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 boolean OCI_API OCI_BindNumber(OCI_Statement *stmt, const otext *name, OCI_Number *data)
Bind an Number variable.
BindMode GetBindMode() const
Return the binding mode of a SQL statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_BindDouble(OCI_Statement *stmt, const otext *name, double *data)
Bind a double variable.
LongMode GetLongMode() const
Return the long data type handling mode of a SQL statement.
Internal usage. Class owning bind objects allowing to set/get C data prior/after a statement executio...
Object identifying the SQL data type DATE.