OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
Binding variables and arrays

Detailed Description

OcilibCApiStatements

OCILIB supports OCI data binding APIs

Programs variables can be binded to an Oracle SQL PL/SQL statement in order to :

OCILIB provides a set of binding functions to use with:

To use binding:

Bindings can be:

OCILIB supports the OCI array Interface by binding arrays of C scalar types and OCILIB object types.

OCILIB does not pre-parse statements (like other frameworks such as JDBC, ...) and lets Oracle recognize input variables embedded within the SQL statements.

Bind variables must be preceded in the SQL code by the character ':'.

Oracle and OCILIB supports two ways of binding:

OCILIB Default binding mode is OCI_BIND_BY_NAME.

When using binding by position, provide the position to OCI_BindXXXX() call through the name parameter. Within this mode the bind name must be the position preceded by a semicolon like ':1', ':2', ....

Internal Bind allocation mode

Bind variables or arrays can be internally allocated by OCILIB. That means that instead of allocating variables or arrays on the stack/heap in the user program, bind contents can be allocated internally and thus :

To do so :

Internal Bind allocation mode IS compatible with ALL array binding OCI_BindArrayOfxxx() methods.

Internal Bind allocation mode IS NOT compatible with some single variable bind calls :

These methods need to know the data sub type (like OCI_CLOB/OCI_BLOB for lobs) in order to internally create variables. As these methods prototypes are not passing the sub type, calling them with the statement bind mode set to OCI_BAM_INTERNAL will raise an OCILIB error of type OCI_ERR_NULL_POINTER

Note
Rebinding is disabled by default (see OCI_AllowRebinding()) When using rebinding feature, host variable re-binded to a previously allocated bind MUST be of the SAME data type !
Basic input bind Example
#include "ocilib.h"
/* requires script demo/products.sql */
int code;
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
void get_product_name(int requested_code)
{
code = requested_code;
rs = OCI_GetResultset(st);
printf("product name for product code %d is %s\n", code, OCI_GetString(rs, 1));
}
int main(void)
{
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
OCI_Prepare(st, "select name from products where code = :code");
OCI_BindInt(st, ":code", &code);
get_product_name(1);
get_product_name(2);
return EXIT_SUCCESS;
}
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_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:124
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:136
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: types.h:390
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
OCI_SYM_PUBLIC const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve error message from error handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetString(OCI_Resultset *rs, unsigned int index)
Return the current string value of the column at the given index in the resultset.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
OCI_SYM_PUBLIC boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
OCI_SYM_PUBLIC boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
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_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
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 boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
Array interface Example
#include "ocilib.h"
/* requires script demo/products.sql */
#define ARRAY_SIZE 1000
#define STRING_SIZE 20
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
int main(void)
{
OCI_Error *err;
int tab_int[ARRAY_SIZE];
char tab_str[ARRAY_SIZE][STRING_SIZE+1];
int i;
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT | OCI_ENV_CONTEXT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
OCI_Prepare(st, "insert into products values(:i, :s)");
OCI_BindArraySetSize(st, ARRAY_SIZE);
OCI_BindArrayOfInts(st, ":i", (int*)tab_int, 0);
OCI_BindArrayOfStrings(st, ":s", (char*)tab_str, STRING_SIZE, 0);
for (i = 0; i < ARRAY_SIZE; i++)
{
tab_int[i] = i + 1;
sprintf(tab_str[i], "Name %d", i + 1);
}
if (!OCI_Execute(st))
{
printf("Number of DML array errors : %d\n", OCI_GetBatchErrorCount(st));
err = OCI_GetBatchError(st);
while (err)
{
printf("Error at row %d : %s\n", OCI_ErrorGetRow(err), OCI_ErrorGetString(err));
err = OCI_GetBatchError(st);
}
}
printf("row inserted : %d\n", OCI_GetAffectedRows(st));
return EXIT_SUCCESS;
}
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBatchErrorCount(OCI_Statement *stmt)
Returns the number of errors that occurred within the last DML array statement.
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 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_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_BindArraySetSize(OCI_Statement *stmt, unsigned int size)
Set the input array size for bulk operations.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ErrorGetRow(OCI_Error *err)
Return the row index which caused an error during statement execution.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
Internal Array interface Example
#include "ocilib.h"
/* requires script demo/dates.sql */
#define ARRAY_SIZE 10
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
int main(void)
{
OCI_Date ** tab;
int i;
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
OCI_SetBindAllocation(st, OCI_BAM_INTERNAL);
OCI_Prepare(st, "insert into dates values (:tab)");
OCI_BindArraySetSize(st, ARRAY_SIZE);
OCI_BindArrayOfDates(st, ":tab", NULL, 0);
for (i = 0; i < ARRAY_SIZE; i++)
{
OCI_DateSysDate(tab[i]);
}
printf("row inserted : %d\n", OCI_GetAffectedRows(st));
return EXIT_SUCCESS;
}
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 void *OCI_API OCI_BindGetData(OCI_Bind *bnd)
Return the user defined data associated with 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.
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: types.h:279
OCI_SYM_PUBLIC boolean OCI_API OCI_DateSysDate(OCI_Date *date)
Return the current system date/time into the date handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetBindAllocation(OCI_Statement *stmt, unsigned int mode)
Set the current bind allocation mode that will be used for subsequent binding calls.

Functions

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 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_AllowRebinding (OCI_Statement *stmt, boolean value)
 Allow different host variables to be binded using the same bind name or position between executions of a prepared statement.
 
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_BindBoolean (OCI_Statement *stmt, const otext *name, boolean *data)
 Bind a boolean variable (PL/SQL ONLY)
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindNumber (OCI_Statement *stmt, const otext *name, OCI_Number *data)
 Bind an Number 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 boolean OCI_API OCI_BindShort (OCI_Statement *stmt, const otext *name, short *data)
 Bind an short 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 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_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_BindInt (OCI_Statement *stmt, const otext *name, int *data)
 Bind an integer variable.
 
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_BindUnsignedInt (OCI_Statement *stmt, const otext *name, unsigned int *data)
 Bind an unsigned integer 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_BindBigInt (OCI_Statement *stmt, const otext *name, big_int *data)
 Bind a big integer 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_BindUnsignedBigInt (OCI_Statement *stmt, const otext *name, big_uint *data)
 Bind an unsigned big integer variable.
 
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_BindString (OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
 Bind a string variable.
 
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_BindRaw (OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
 Bind a raw buffer.
 
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_BindDouble (OCI_Statement *stmt, const otext *name, double *data)
 Bind a double variable.
 
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 boolean OCI_API OCI_BindFloat (OCI_Statement *stmt, const otext *name, float *data)
 Bind a float variable.
 
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_BindDate (OCI_Statement *stmt, const otext *name, OCI_Date *data)
 Bind a date 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.
 
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_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 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_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_BindLob (OCI_Statement *stmt, const otext *name, OCI_Lob *data)
 Bind a Lob variable.
 
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_BindFile (OCI_Statement *stmt, const otext *name, OCI_File *data)
 Bind a File 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_BindObject (OCI_Statement *stmt, const otext *name, OCI_Object *data)
 Bind an object (named type) 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_BindColl (OCI_Statement *stmt, const otext *name, OCI_Coll *data)
 Bind a Collection variable.
 
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_BindRef (OCI_Statement *stmt, const otext *name, OCI_Ref *data)
 Bind a Ref 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_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_BindLong (OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
 Bind a Long variable.
 
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 unsigned int OCI_API OCI_GetBatchErrorCount (OCI_Statement *stmt)
 Returns the number of errors that occurred within the last DML array statement.
 
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 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 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_GetBindIndex (OCI_Statement *stmt, const otext *name)
 Return the index of the bind from its name belonging to the given statement.
 
OCI_SYM_PUBLIC const otext *OCI_API OCI_BindGetName (OCI_Bind *bnd)
 Return the name of the given bind.
 
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 unsigned int OCI_API OCI_BindGetDirection (OCI_Bind *bnd)
 Get the direction mode of a bind handle.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetType (OCI_Bind *bnd)
 Return the OCILIB type of the given bind.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetSubtype (OCI_Bind *bnd)
 Return the OCILIB object subtype of the given bind.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataCount (OCI_Bind *bnd)
 Return the number of elements of the bind handle.
 
OCI_SYM_PUBLIC void *OCI_API OCI_BindGetData (OCI_Bind *bnd)
 Return the user defined data associated with a bind handle.
 
OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_BindGetStatement (OCI_Bind *bnd)
 Return the statement handle associated with a bind handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDataSize (OCI_Bind *bnd, unsigned int size)
 Set the actual size of the element held by the given bind handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDataSizeAtPos (OCI_Bind *bnd, unsigned int position, unsigned int size)
 Set the size of the element at the given position in the bind input array.
 
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.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataSizeAtPos (OCI_Bind *bnd, unsigned int position)
 Return the actual size of the element at the given position in the bind input array.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNull (OCI_Bind *bnd)
 Set the bind variable to null.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNullAtPos (OCI_Bind *bnd, unsigned int position)
 Set to null the entry in the bind variable input array.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNotNull (OCI_Bind *bnd)
 Set the bind variable to NOT null.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNotNullAtPos (OCI_Bind *bnd, unsigned int position)
 Set to NOT null the entry in the bind variable input array.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindIsNull (OCI_Bind *bnd)
 Check if the current value of the binded variable is marked as NULL.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindIsNullAtPos (OCI_Bind *bnd, unsigned int position)
 Check if the current entry value at the given index of the binded array is marked as NULL.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetCharsetForm (OCI_Bind *bnd, unsigned int csfrm)
 Set the charset form of the given character based bind variable.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetAllocationMode (OCI_Bind *bnd)
 Get the allocation mode of a bind handle.
 

Function Documentation

◆ OCI_BindArraySetSize()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArraySetSize ( OCI_Statement stmt,
unsigned int  size 
)

#include <api.h>

Set the input array size for bulk operations.

Parameters
stmt- Statement handle
size- Array size
Warning
Do not use OCI_BindArraySetSize() for PL/SQL tables binding
Note
OCI_BindArraySetSize() is used to set the size of input bind array when using arrays for DML statements. OCI_BindArraySetSize() MUST be called to set the maximum size of the arrays to bind to the statement before any of its execution. This initial call must be bone AFTER OCI_Prepare() and BEFORE any OCI_BindArrayOfxxx() call.
OCI_BindArraySetSize() can optionally be called before any later OCI_Execute() call in order to notify the statement of the exact number of elements populating the input arrays for the next execution. The array size passed to later OCI_BindArraySetSize() calls cannot be greater than the initial size otherwise an exception will be thrown.
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Statement::SetBindArraySize().

◆ OCI_BindArrayGetSize()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindArrayGetSize ( OCI_Statement stmt)

#include <api.h>

Return the current input array size for bulk operations.

Parameters
stmt- Statement handle
Returns
Array size value or 0 if OCI_BindArraySetSize() has not been called

Referenced by ocilib::Statement::GetBindArraySize().

◆ OCI_AllowRebinding()

OCI_SYM_PUBLIC boolean OCI_API OCI_AllowRebinding ( OCI_Statement stmt,
boolean  value 
)

#include <api.h>

Allow different host variables to be binded using the same bind name or position between executions of a prepared statement.

Parameters
stmt- Statement handle
value- Rebinding mode allowed
Note
Default value is FALSE
Warning
When using rebinding feature, host variable re-binded to a previously allocated bind MUST be of the same data type !
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Statement::AllowRebinding().

◆ OCI_IsRebindingAllowed()

OCI_SYM_PUBLIC boolean OCI_API OCI_IsRebindingAllowed ( OCI_Statement stmt)

#include <api.h>

Indicate if rebinding is allowed on the given statement.

Parameters
stmt- Statement handle
Note
See OCI_AllowRebinding() for more details
Returns
TRUE if allowed otherwise FALSE

Referenced by ocilib::Statement::IsRebindingAllowed().

◆ OCI_BindBoolean()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindBoolean ( OCI_Statement stmt,
const otext *  name,
boolean *  data 
)

#include <api.h>

Bind a boolean variable (PL/SQL ONLY)

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to boolean variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Warning
  • OCI_BindBoolean() CAN ONLY BE USED for PL/SQL boolean type when calling PL/SQL procedures/function
  • ONLY supported by Oracle 12c and above !
Returns
TRUE on success otherwise FALSE

◆ OCI_BindNumber()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindNumber ( OCI_Statement stmt,
const otext *  name,
OCI_Number data 
)

#include <api.h>

Bind an Number variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to short variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfNumbers()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfNumbers ( OCI_Statement stmt,
const otext *  name,
OCI_Number **  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of Number.

Parameters
stmt- Statement handle
name- Variable name
data- Array of numbers
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindShort()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindShort ( OCI_Statement stmt,
const otext *  name,
short *  data 
)

#include <api.h>

Bind an short variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to short variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfShorts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfShorts ( OCI_Statement stmt,
const otext *  name,
short *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of shorts.

Parameters
stmt- Statement handle
name- Variable name
data- Array of shorts
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindUnsignedShort()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedShort ( OCI_Statement stmt,
const otext *  name,
unsigned short *  data 
)

#include <api.h>

Bind an unsigned short variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to unsigned short variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfUnsignedShorts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedShorts ( OCI_Statement stmt,
const otext *  name,
unsigned short *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of unsigned shorts.

Parameters
stmt- Statement handle
name- Variable name
data- Array of unsigned shorts
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindInt ( OCI_Statement stmt,
const otext *  name,
int *  data 
)

#include <api.h>

Bind an integer variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to int variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfInts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfInts ( OCI_Statement stmt,
const otext *  name,
int *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of integers.

Parameters
stmt- Statement handle
name- Variable name
data- Array of int
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindUnsignedInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedInt ( OCI_Statement stmt,
const otext *  name,
unsigned int *  data 
)

#include <api.h>

Bind an unsigned integer variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to unsigned int variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfUnsignedInts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedInts ( OCI_Statement stmt,
const otext *  name,
unsigned int *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of unsigned integers.

Parameters
stmt- Statement handle
name- Variable name
data- Array of unsigned int
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindBigInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindBigInt ( OCI_Statement stmt,
const otext *  name,
big_int data 
)

#include <api.h>

Bind a big integer variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to big int variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfBigInts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfBigInts ( OCI_Statement stmt,
const otext *  name,
big_int data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of big integers.

Parameters
stmt- Statement handle
name- Variable name
data- Array of big int
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindUnsignedBigInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindUnsignedBigInt ( OCI_Statement stmt,
const otext *  name,
big_uint *  data 
)

#include <api.h>

Bind an unsigned big integer variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to unsigned big int variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfUnsignedBigInts()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfUnsignedBigInts ( OCI_Statement stmt,
const otext *  name,
big_uint *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of unsigned big integers.

Parameters
stmt- Statement handle
name- Variable name
data- Array of unsigned big int
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindString()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindString ( OCI_Statement stmt,
const otext *  name,
otext *  data,
unsigned int  len 
)

#include <api.h>

Bind a string variable.

Parameters
stmt- Statement handle
name- Variable name
data- String to bind
len- Max length of the string (in character without the zero null terminal character)
Note
if len == 0, len is set to the string size
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfStrings()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfStrings ( OCI_Statement stmt,
const otext *  name,
otext *  data,
unsigned int  len,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of strings.

Parameters
stmt- Statement handle
name- Variable name
data- Array of string
len- Max length of a single string element (in character without the zero null terminal character)
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Warning
if len <= 0, it returns FALSE
Returns
TRUE on success otherwise FALSE

◆ OCI_BindRaw()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindRaw ( OCI_Statement stmt,
const otext *  name,
void *  data,
unsigned int  len 
)

#include <api.h>

Bind a raw buffer.

Parameters
stmt- Statement handle
name- Variable name
data- buffer to bind
len- Max length of the buffer
Note
if len <= 0, it returns false
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfRaws()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfRaws ( OCI_Statement stmt,
const otext *  name,
void *  data,
unsigned int  len,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of raw buffers.

Parameters
stmt- Statement handle
name- Variable name
data- Array of buffers
len- Size in bytes on a single RAW array element
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
The buffer must be a contiguous block of data elements
If len <= 0, it returns FALSE
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindDouble()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindDouble ( OCI_Statement stmt,
const otext *  name,
double *  data 
)

#include <api.h>

Bind a double variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to double variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfDoubles()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfDoubles ( OCI_Statement stmt,
const otext *  name,
double *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of doubles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of double
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindFloat()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindFloat ( OCI_Statement stmt,
const otext *  name,
float *  data 
)

#include <api.h>

Bind a float variable.

Parameters
stmt- Statement handle
name- Variable name
data- Pointer to float variable
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfFloats()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfFloats ( OCI_Statement stmt,
const otext *  name,
float *  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of floats.

Parameters
stmt- Statement handle
name- Variable name
data- Array of float
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindDate()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindDate ( OCI_Statement stmt,
const otext *  name,
OCI_Date data 
)

#include <api.h>

Bind a date variable.

Parameters
stmt- Statement handle
name- Variable name
data- Date handle
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfDates()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfDates ( OCI_Statement stmt,
const otext *  name,
OCI_Date **  data,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of dates.

Parameters
stmt- Statement handle
name- Variable name
data- Array of date handle
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindTimestamp()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindTimestamp ( OCI_Statement stmt,
const otext *  name,
OCI_Timestamp data 
)

#include <api.h>

Bind a timestamp variable.

Parameters
stmt- Statement handle
name- Variable name
data- Timestamp handle
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfTimestamps()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfTimestamps ( OCI_Statement stmt,
const otext *  name,
OCI_Timestamp **  data,
unsigned int  type,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of timestamp handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of Timestamp handle
type- Timestamp type
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
See OCI_TimestampCreate() for possible values of parameter 'type'
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindInterval()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindInterval ( OCI_Statement stmt,
const otext *  name,
OCI_Interval data 
)

#include <api.h>

Bind an interval variable.

Parameters
stmt- Statement handle
name- Variable name
data- Interval handle
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfIntervals()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfIntervals ( OCI_Statement stmt,
const otext *  name,
OCI_Interval **  data,
unsigned int  type,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of interval handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of Interval handle
type- Interval type
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
See OCI_IntervalCreate() for possible values of parameter 'type'
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindLob()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindLob ( OCI_Statement stmt,
const otext *  name,
OCI_Lob data 
)

#include <api.h>

Bind a Lob variable.

Parameters
stmt- Statement handle
name- Variable name
data- Lob handle
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfLobs()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfLobs ( OCI_Statement stmt,
const otext *  name,
OCI_Lob **  data,
unsigned int  type,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of Lob handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of Lob handle
type- Lob type
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
See OCI_LobCreate() for possible values of parameter 'type'
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindFile()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindFile ( OCI_Statement stmt,
const otext *  name,
OCI_File data 
)

#include <api.h>

Bind a File variable.

Parameters
stmt- Statement handle
name- Variable name
data- File handle
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfFiles()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfFiles ( OCI_Statement stmt,
const otext *  name,
OCI_File **  data,
unsigned int  type,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of File handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of File handle
type- File type
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
See OCI_FileCreate() for possible values of parameter 'type'
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindObject()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindObject ( OCI_Statement stmt,
const otext *  name,
OCI_Object data 
)

#include <api.h>

Bind an object (named type) variable.

Parameters
stmt- Statement handle
name- Variable name
data- Object handle
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfObjects()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfObjects ( OCI_Statement stmt,
const otext *  name,
OCI_Object **  data,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of object handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of object handle
typinf- type info handle
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindColl()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindColl ( OCI_Statement stmt,
const otext *  name,
OCI_Coll data 
)

#include <api.h>

Bind a Collection variable.

Parameters
stmt- Statement handle
name- Variable name
data- Collection handle to bind
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Statement::Bind().

◆ OCI_BindArrayOfColls()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfColls ( OCI_Statement stmt,
const otext *  name,
OCI_Coll **  data,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of Collection handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of Collection handle
typinf- Type info handle
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
See OCI_CollCreate() for possible values of parameter 'type'
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Statement::Bind().

◆ OCI_BindRef()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindRef ( OCI_Statement stmt,
const otext *  name,
OCI_Ref data 
)

#include <api.h>

Bind a Ref variable.

Parameters
stmt- Statement handle
name- Variable name
data- Ref handle to bind
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindArrayOfRefs()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindArrayOfRefs ( OCI_Statement stmt,
const otext *  name,
OCI_Ref **  data,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

#include <api.h>

Bind an array of Ref handles.

Parameters
stmt- Statement handle
name- Variable name
data- Array of Ref handle
typinf- type info handle
nbelem- Number of element in the array (PL/SQL table only)
Warning
Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. For regular DML array operations, pass the value 0.
Note
parameter 'data' can NULL if the statement bind allocation mode has been set to OCI_BAM_INTERNAL
Returns
TRUE on success otherwise FALSE

◆ OCI_BindStatement()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindStatement ( OCI_Statement stmt,
const otext *  name,
OCI_Statement data 
)

#include <api.h>

Bind a Statement variable (PL/SQL Ref Cursor)

Parameters
stmt- Statement handle
name- Variable name
data- Statement handle to bind
Note
parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported
Returns
TRUE on success otherwise FALSE

◆ OCI_BindLong()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindLong ( OCI_Statement stmt,
const otext *  name,
OCI_Long data,
unsigned int  size 
)

#include <api.h>

Bind a Long variable.

Parameters
stmt- Statement handle
name- Variable name
data- Long handle
size- Size of the long buffer in bytes or characters
Note
Size is expressed in:
  • Bytes for BLONGs
  • Characters for CLONGs
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns
TRUE on success otherwise FALSE

◆ OCI_GetBatchError()

OCI_SYM_PUBLIC OCI_Error *OCI_API OCI_GetBatchError ( OCI_Statement stmt)

#include <api.h>

Returns the first or next error that occurred within a DML array statement execution.

Parameters
stmt- Statement handle
Returns
The first or next error handle otherwise NULL

Referenced by ocilib::Statement::GetBatchErrors().

◆ OCI_GetBatchErrorCount()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBatchErrorCount ( OCI_Statement stmt)

#include <api.h>

Returns the number of errors that occurred within the last DML array statement.

Parameters
stmt- Statement handle

◆ OCI_GetBindCount()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBindCount ( OCI_Statement stmt)

#include <api.h>

Return the number of binds currently associated to a statement.

Parameters
stmt- Statement handle

Referenced by ocilib::Statement::GetBindCount().

◆ OCI_GetBind()

OCI_SYM_PUBLIC OCI_Bind *OCI_API OCI_GetBind ( OCI_Statement stmt,
unsigned int  index 
)

#include <api.h>

Return the bind handle at the given index in the internal array of bind handle.

Parameters
stmt- Statement handle
index- Bind position
Note
Index starts at 1.
Bind handle are created sequentially. For example, the third call to a OCI_BindXXX() generates a bind handle of index 3.
Returns
The bind handle or NULL if index is out of bounds

Referenced by ocilib::Statement::GetBind().

◆ OCI_GetBind2()

OCI_SYM_PUBLIC OCI_Bind *OCI_API OCI_GetBind2 ( OCI_Statement stmt,
const otext *  name 
)

#include <api.h>

Return a bind handle from its name.

Parameters
stmt- Statement handle
name- Bind variable name
Note
Bind names must include a semicolon at the beginning.
Returns
The bind handle or NULL if not found

Referenced by ocilib::Statement::GetBind().

◆ OCI_GetBindIndex()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetBindIndex ( OCI_Statement stmt,
const otext *  name 
)

#include <api.h>

Return the index of the bind from its name belonging to the given statement.

Parameters
stmt- Statement handle
name- Bind variable name
Warning
The bind name is case insensitive
Note
Bind indexes start with 1 in OCILIB
Returns
Bind index on success or zero if the bind does not exists or if statement is NULL

Referenced by ocilib::Statement::GetBindIndex().

◆ OCI_BindGetName()

OCI_SYM_PUBLIC const otext *OCI_API OCI_BindGetName ( OCI_Bind bnd)

#include <api.h>

Return the name of the given bind.

Parameters
bnd- Bind handle

Referenced by ocilib::BindInfo::GetName().

◆ OCI_BindSetDirection()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDirection ( OCI_Bind bnd,
unsigned int  direction 
)

#include <api.h>

Set the direction mode of a bind handle.

Parameters
bnd- Bind handle
direction- direction mode
Note
Possible values for parameter 'direction' :
  • OCI_BDM_IN : input values (not modified by the server)
  • OCI_BDM_OUT : output values (modified by the server)
  • OCI_BDM_IN_OUT : input and output values
Default value is OCI_BDM_IN_OUT
Returns
TRUE on success otherwise FALSE

◆ OCI_BindGetDirection()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDirection ( OCI_Bind bnd)

#include <api.h>

Get the direction mode of a bind handle.

Parameters
bnd- Bind handle
Note
see OCI_BindSetDirection() for more details

return the bind direction mode on success otherwise OCI_UNKNWON

Referenced by ocilib::BindInfo::GetDirection().

◆ OCI_BindGetType()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetType ( OCI_Bind bnd)

#include <api.h>

Return the OCILIB type of the given bind.

Parameters
bnd- Bind handle
Note
Possible values are :
  • OCI_CDT_NUMERIC : short, int, long long, float, double
  • OCI_CDT_DATETIME : OCI_Date *
  • OCI_CDT_TEXT : otext *
  • OCI_CDT_LONG : OCI_Long *
  • OCI_CDT_CURSOR : OCI_Statement *
  • OCI_CDT_LOB : OCI_Lob *
  • OCI_CDT_FILE : OCI_File *
  • OCI_CDT_TIMESTAMP : OCI_Timestamp *
  • OCI_CDT_INTERVAL : OCI_Interval *
  • OCI_CDT_RAW : void *
  • OCI_CDT_OBJECT : OCI_Object *
  • OCI_CDT_COLLECTION : OCI_Coll *
  • OCI_CDT_REF : OCI_Ref *
  • OCI_CDT_BOOLEAN : boolean
Returns
The column type or OCI_CDT_UNKNOWN on error

Referenced by ocilib::BindInfo::GetType().

◆ OCI_BindGetSubtype()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetSubtype ( OCI_Bind bnd)

#include <api.h>

Return the OCILIB object subtype of the given bind.

Parameters
bnd- Bind handle
Note
  • This call is valid for the following OCILIB types:
  • OCI_CDT_NUMERIC
  • OCI_CDT_LONG
  • OCI_CDT_LOB
  • OCI_CDT_FILE
  • OCI_CDT_TIMESTAMP
  • OCI_CDT_INTERVAL

For numeric binds the possible values are:

  • OCI_NUM_SHORT
  • OCI_NUM_INT
  • OCI_NUM_BIGINT
  • OCI_NUM_USHORT
  • OCI_NUM_UINT
  • OCI_NUM_BIGUINT
  • OCI_NUM_DOUBLE
  • OCI_NUM_FLOAT
  • OCI_NUM_NUMBER

For OCI_Long type the possible values are:

  • OCI_BLONG
  • OCI_CLONG

For OCI_Lob type the possible values are:

  • OCI_BLOB
  • OCI_CLOB
  • OCI_NCLOB

For OCI_File type the possible values are:

  • OCI_BFILE
  • OCI_CFILE

For OCI_Timestamp type the possible values are:

  • OCI_TIMESTAMP
  • OCI_TIMESTAMP_TZ
  • OCI_TIMESTAMP_LTZ

For OCI_Interval type the possible values are:

  • OCI_INTERVAL_YM
  • OCI_INTERVAL_DS
Note
For all other OCILIB types, it returns OCI_UNKNOWN

Referenced by ocilib::BindInfo::GetSubType().

◆ OCI_BindGetDataCount()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataCount ( OCI_Bind bnd)

#include <api.h>

Return the number of elements of the bind handle.

Parameters
bnd- Bind handle
Returns
  • For single binds, it returns 1
  • For array binds, it returns the number of element in the array

Referenced by ocilib::BindInfo::GetDataCount().

◆ OCI_BindGetData()

OCI_SYM_PUBLIC void *OCI_API OCI_BindGetData ( OCI_Bind bnd)

#include <api.h>

Return the user defined data associated with a bind handle.

Parameters
bnd- Bind handle
Returns
  • The pointer to variable/array passed to an OCI_BindXXX() or OCI_BindArrayOfXXX() call

◆ OCI_BindGetStatement()

OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_BindGetStatement ( OCI_Bind bnd)

#include <api.h>

Return the statement handle associated with a bind handle.

Parameters
bnd- bind handle

Referenced by ocilib::BindInfo::GetStatement().

◆ OCI_BindSetDataSize()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDataSize ( OCI_Bind bnd,
unsigned int  size 
)

#include <api.h>

Set the actual size of the element held by the given bind handle.

Parameters
bnd- bind handle
size- data size
Note
This call is not mandatory and should ONLY be called for RAWs binds to set the real size of the given data if different from the expected column or parameter size
It works as well with string based PL/SQL tables (in or in/out but NOT out) even if it's not necessary.
Warning
For binds of type OCI_CDT_TEXT (strings), the parameter 'size' is expressed in number of characters.
Returns
Data size if the bind type is listed above otherwise 0.

◆ OCI_BindSetDataSizeAtPos()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetDataSizeAtPos ( OCI_Bind bnd,
unsigned int  position,
unsigned int  size 
)

#include <api.h>

Set the size of the element at the given position in the bind input array.

Parameters
bnd- bind handle
position- Position in the array
size- data size
Note
See OCI_BindSetDataSize() for supported data types
Warning
Before execution, it returns the max default size for the bind and not the real data size, unless a custom size has been set with OCI_BindSetDataSizeXXX() After execution, it returns the real data size.
For binds of type OCI_CDT_TEXT (strings), the parameter 'size' is expressed in number of characters.
Returns
Data size if the bind type is listed above otherwise 0.

◆ OCI_BindGetDataSize()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataSize ( OCI_Bind bnd)

#include <api.h>

Return the actual size of the element held by the given bind handle.

Parameters
bnd- bind handle
Note
See OCI_BindSetDataSize() for supported data types
Warning
For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in number of characters.

◆ OCI_BindGetDataSizeAtPos()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetDataSizeAtPos ( OCI_Bind bnd,
unsigned int  position 
)

#include <api.h>

Return the actual size of the element at the given position in the bind input array.

Parameters
bnd- bind handle
position- Position in the array
Note
See OCI_BindSetDataSize() for supported data types
Warning
For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in number of characters.

◆ OCI_BindSetNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNull ( OCI_Bind bnd)

#include <api.h>

Set the bind variable to null.

Parameters
bnd- Bind handle
Note
There is no notion of null value in C. It's necessary to explicitly tell Oracle that the bind has a null value. It must be done before an OCI_Execute() call
For handled based data types (non scalar types), OCILIB performs an extra check on handles and set the bind status to null is the handle is null
Returns
TRUE on success otherwise FALSE

◆ OCI_BindSetNullAtPos()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNullAtPos ( OCI_Bind bnd,
unsigned int  position 
)

#include <api.h>

Set to null the entry in the bind variable input array.

Parameters
bnd- Bind handle
position- Position in the array
Note
There is no notion of null value in C. It's necessary to explicitly tell Oracle that the bind has a null value. It must be done before an OCI_Execute() call
Warning
Position starts with 1
Note
For handled based data types (non scalar types), OCILIB performs an extra check on handles and set the bind status to null is the handle is null
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::BindInfo::SetDataNull().

◆ OCI_BindSetNotNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNotNull ( OCI_Bind bnd)

#include <api.h>

Set the bind variable to NOT null.

Parameters
bnd- Bind handle
Note
There is no notion of null value in C. It's necessary to explicitly tell Oracle that the bind has a null value. It must be done before an OCI_Execute() call
For handled based data types (non scalar types), OCILIB performs an extra check on handles and set the bind status to null is the handle is null
Returns
TRUE on success otherwise FALSE

◆ OCI_BindSetNotNullAtPos()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetNotNullAtPos ( OCI_Bind bnd,
unsigned int  position 
)

#include <api.h>

Set to NOT null the entry in the bind variable input array.

Parameters
bnd- Bind handle
position- Position in the array
Note
There is no notion of null value in C. It's necessary to explicitly tell Oracle that the bind has a null value. It must be done before an OCI_Execute() call
Warning
Position starts with 1
Note
For handled based data types (non scalar types), OCILIB performs an extra check on handles and set the bind status to null is the handle is null
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::BindInfo::SetDataNull().

◆ OCI_BindIsNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindIsNull ( OCI_Bind bnd)

#include <api.h>

Check if the current value of the binded variable is marked as NULL.

Parameters
bnd- Bind handle
Returns
TRUE if it's null otherwise FALSE

◆ OCI_BindIsNullAtPos()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindIsNullAtPos ( OCI_Bind bnd,
unsigned int  position 
)

#include <api.h>

Check if the current entry value at the given index of the binded array is marked as NULL.

Parameters
bnd- Bind handle
position- Position in the array
Warning
Position starts with 1
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::BindInfo::IsDataNull().

◆ OCI_BindSetCharsetForm()

OCI_SYM_PUBLIC boolean OCI_API OCI_BindSetCharsetForm ( OCI_Bind bnd,
unsigned int  csfrm 
)

#include <api.h>

Set the charset form of the given character based bind variable.

Parameters
bnd- Bind handle
csfrm- charset form
Note
Possible values are :
  • OCI_CSF_DEFAULT : the column has default charset
  • OCI_CSF_NATIONAL: the column has national charset
Note
This call has to be made after OCI_Prepare() but before OCI_Execute()
Warning
This call does nothing :
  • if the csform is out of range
  • if the bind type is not OCI_CFT_TEXT or OCI_CDT_LONG
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::BindInfo::SetCharsetForm().

◆ OCI_BindGetAllocationMode()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_BindGetAllocationMode ( OCI_Bind bnd)

#include <api.h>

Get the allocation mode of a bind handle.

Parameters
bnd- Bind handle
Note
Possible values are :
  • OCI_BAM_EXTERNAL : bind variable is allocated by user code
  • OCI_BAM_INTERNAL : bind variable is allocated internally

return the allocation mode on success otherwise OCI_UNKNOWN