OCILIB (C Driver for Oracle) 3.12.1
Functions
Binding variables and arrays

Detailed Description

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:

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

From version 3.7.0, 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 rebinded to a previously allocated bind MUST be of the SAME datatype !
Basic input bind Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement *st;

    int code;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
 
    st = OCI_StatementCreate(cn);
  
    OCI_Prepare(st, "delete from test_fetch where code = :code");
    OCI_BindInt(st, ":code", &code);
    
    code = 5;
    OCI_Execute(st);

    code = 12;
    OCI_Execute(st);
   
    OCI_Commit(cn);

    OCI_Cleanup();
 
    return EXIT_SUCCESS;
}
Array interface Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement  *st;
    OCI_Error      *err;

    int tab_int[1000];
    char tab_str[1000][21];

    int i;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT | OCI_ENV_CONTEXT))
        return EXIT_FAILURE;

    /* ... create connection and statement ... */

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    st = OCI_StatementCreate(cn);
 
    /* binding */

    OCI_Prepare(st, "insert into products values(:i, :s)");
    OCI_BindArraySetSize(st, 1000);
    OCI_BindArrayOfInts(st, ":i", (int*) tab_int, 0);
    OCI_BindArrayOfStrings(st, ":s", (char*) tab_str, 20, 0);

    /* filling arrays */

    for(i=0;i<1000;i++)
    {
        tab_int[i] = i+1;
        sprintf(tab_str[i],"Name %d",i+1);
    }

    /* execute */

    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 processed : %d\n", OCI_GetAffectedRows(st));

    OCI_Commit(cn);

    OCI_Cleanup();

    return EXIT_SUCCESS;
}
Internal Array interface Example
#include "ocilib.h"

#define NB_ELEMS 1000

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement *st;
    int i;

    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
 
    st = OCI_StatementCreate(cn);
   
    OCI_SetBindAllocation(st, OCI_BAM_INTERNAL);

    OCI_Prepare(st, "insert into test_array values (:tab)");

    OCI_BindArraySetSize(st, NB_ELEMS);

    OCI_BindArrayOfDates(st, ":tab", NULL, 0);
    {
        OCI_Date ** tab = (OCI_Date **) OCI_BindGetData(OCI_GetBind(st, 1));

        for (i=0; i < NB_ELEMS; i++)
        {
            OCI_DateSysDate(tab[i]);
        }

        OCI_Execute(st);
    }

    OCI_Commit(cn); 

    OCI_Cleanup();
 
    return EXIT_SUCCESS;
}

Functions

OCI_EXPORT boolean OCI_API OCI_BindArraySetSize (OCI_Statement *stmt, unsigned int size)
 Set the input array size for bulk operations.
OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize (OCI_Statement *stmt)
 Return the current input array size for bulk operations.
OCI_EXPORT 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_EXPORT boolean OCI_API OCI_BindShort (OCI_Statement *stmt, const mtext *name, short *data)
 Bind an short variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfShorts (OCI_Statement *stmt, const mtext *name, short *data, unsigned int nbelem)
 Bind an array of shorts.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort (OCI_Statement *stmt, const mtext *name, unsigned short *data)
 Bind an unsigned short variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedShorts (OCI_Statement *stmt, const mtext *name, unsigned short *data, unsigned int nbelem)
 Bind an array of unsigned shorts.
OCI_EXPORT boolean OCI_API OCI_BindInt (OCI_Statement *stmt, const mtext *name, int *data)
 Bind an integer variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts (OCI_Statement *stmt, const mtext *name, int *data, unsigned int nbelem)
 Bind an array of integers.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt (OCI_Statement *stmt, const mtext *name, unsigned int *data)
 Bind an unsigned integer variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedInts (OCI_Statement *stmt, const mtext *name, unsigned int *data, unsigned int nbelem)
 Bind an array of unsigned integers.
OCI_EXPORT boolean OCI_API OCI_BindBigInt (OCI_Statement *stmt, const mtext *name, big_int *data)
 Bind a big integer variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfBigInts (OCI_Statement *stmt, const mtext *name, big_int *data, unsigned int nbelem)
 Bind an array of big integers.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt (OCI_Statement *stmt, const mtext *name, big_uint *data)
 Bind an unsigned big integer variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedBigInts (OCI_Statement *stmt, const mtext *name, big_uint *data, unsigned int nbelem)
 Bind an array of unsigned big integers.
OCI_EXPORT boolean OCI_API OCI_BindString (OCI_Statement *stmt, const mtext *name, dtext *data, unsigned int len)
 Bind a string variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfStrings (OCI_Statement *stmt, const mtext *name, dtext *data, unsigned int len, unsigned int nbelem)
 Bind an array of strings.
OCI_EXPORT boolean OCI_API OCI_BindRaw (OCI_Statement *stmt, const mtext *name, void *data, unsigned int len)
 Bind a raw buffer.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRaws (OCI_Statement *stmt, const mtext *name, void *data, unsigned int len, unsigned int nbelem)
 Bind an array of raw buffers.
OCI_EXPORT boolean OCI_API OCI_BindDouble (OCI_Statement *stmt, const mtext *name, double *data)
 Bind a double variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDoubles (OCI_Statement *stmt, const mtext *name, double *data, unsigned int nbelem)
 Bind an array of doubles.
OCI_EXPORT boolean OCI_API OCI_BindFloat (OCI_Statement *stmt, const mtext *name, float *data)
 Bind a float variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFloats (OCI_Statement *stmt, const mtext *name, float *data, unsigned int nbelem)
 Bind an array of floats.
OCI_EXPORT boolean OCI_API OCI_BindDate (OCI_Statement *stmt, const mtext *name, OCI_Date *data)
 Bind a date variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDates (OCI_Statement *stmt, const mtext *name, OCI_Date **data, unsigned int nbelem)
 Bind an array of dates.
OCI_EXPORT boolean OCI_API OCI_BindTimestamp (OCI_Statement *stmt, const mtext *name, OCI_Timestamp *data)
 Bind a timestamp variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfTimestamps (OCI_Statement *stmt, const mtext *name, OCI_Timestamp **data, unsigned int type, unsigned int nbelem)
 Bind an array of timestamp handles.
OCI_EXPORT boolean OCI_API OCI_BindInterval (OCI_Statement *stmt, const mtext *name, OCI_Interval *data)
 Bind an interval variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfIntervals (OCI_Statement *stmt, const mtext *name, OCI_Interval **data, unsigned int type, unsigned int nbelem)
 Bind an array of interval handles.
OCI_EXPORT boolean OCI_API OCI_BindLob (OCI_Statement *stmt, const mtext *name, OCI_Lob *data)
 Bind a Lob variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfLobs (OCI_Statement *stmt, const mtext *name, OCI_Lob **data, unsigned int type, unsigned int nbelem)
 Bind an array of Lob handles.
OCI_EXPORT boolean OCI_API OCI_BindFile (OCI_Statement *stmt, const mtext *name, OCI_File *data)
 Bind a File variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFiles (OCI_Statement *stmt, const mtext *name, OCI_File **data, unsigned int type, unsigned int nbelem)
 Bind an array of File handles.
OCI_EXPORT boolean OCI_API OCI_BindObject (OCI_Statement *stmt, const mtext *name, OCI_Object *data)
 Bind an object (named type) variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfObjects (OCI_Statement *stmt, const mtext *name, OCI_Object **data, OCI_TypeInfo *typinf, unsigned int nbelem)
 Bind an array of object handles.
OCI_EXPORT boolean OCI_API OCI_BindColl (OCI_Statement *stmt, const mtext *name, OCI_Coll *data)
 Bind a Collection variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfColls (OCI_Statement *stmt, const mtext *name, OCI_Coll **data, OCI_TypeInfo *typinf, unsigned int nbelem)
 Bind an array of Collection handles.
OCI_EXPORT boolean OCI_API OCI_BindRef (OCI_Statement *stmt, const mtext *name, OCI_Ref *data)
 Bind a Ref variable.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRefs (OCI_Statement *stmt, const mtext *name, OCI_Ref **data, OCI_TypeInfo *typinf, unsigned int nbelem)
 Bind an array of Ref handles.
OCI_EXPORT boolean OCI_API OCI_BindStatement (OCI_Statement *stmt, const mtext *name, OCI_Statement *data)
 Bind a Statement variable (PL/SQL Ref Cursor)
OCI_EXPORT boolean OCI_API OCI_BindLong (OCI_Statement *stmt, const mtext *name, OCI_Long *data, unsigned int size)
 Bind a Long variable.
OCI_EXPORT OCI_Error *OCI_API OCI_GetBatchError (OCI_Statement *stmt)
 Returns the first or next error that occurred within a DML array statement.
OCI_EXPORT unsigned int OCI_API OCI_GetBatchErrorCount (OCI_Statement *stmt)
 Returns the number of errors that occurred within the last DML array statement.
OCI_EXPORT unsigned int OCI_API OCI_GetBindCount (OCI_Statement *stmt)
 Return the number of binds currently associated to a statement.
OCI_EXPORT 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_EXPORT OCI_Bind *OCI_API OCI_GetBind2 (OCI_Statement *stmt, const mtext *name)
 Return a bind handle from its name.
OCI_EXPORT const mtext *OCI_API OCI_BindGetName (OCI_Bind *bnd)
 Return the name of the given bind.
OCI_EXPORT boolean OCI_API OCI_BindSetDirection (OCI_Bind *bnd, unsigned int direction)
 Set the direction mode of a bind handle.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection (OCI_Bind *bnd)
 Get the direction mode of a bind handle.
OCI_EXPORT unsigned int OCI_API OCI_BindGetType (OCI_Bind *bnd)
 Return the OCILIB type of the given bind.
OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype (OCI_Bind *bnd)
 Return the OCILIB object subtype of the given bind.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount (OCI_Bind *bnd)
 Return the number of elements of the bind handle.
OCI_EXPORT void *OCI_API OCI_BindGetData (OCI_Bind *bnd)
 Return the user defined data associated with a bind handle.
OCI_EXPORT OCI_Statement *OCI_API OCI_BindGetStatement (OCI_Bind *bnd)
 Return the statement handle associated with a bind handle.
OCI_EXPORT 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_EXPORT 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_EXPORT unsigned int OCI_API OCI_BindGetDataSize (OCI_Bind *bnd)
 Return the actual size of the element held by the given bind handle.
OCI_EXPORT 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_EXPORT boolean OCI_API OCI_BindSetNull (OCI_Bind *bnd)
 Set the bind variable to null.
OCI_EXPORT boolean OCI_API OCI_BindSetNullAtPos (OCI_Bind *bnd, unsigned int position)
 Set to null the entry in the bind variable input array.
OCI_EXPORT boolean OCI_API OCI_BindIsNull (OCI_Bind *bnd)
 Check if the current value of the binded variable is marked as NULL.
OCI_EXPORT 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.
boolean OCI_API OCI_BindSetCharsetForm (OCI_Bind *bnd, unsigned int csfrm)
 Set the charset form of the given character based bind variable.

Function Documentation

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

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

Definition at line 2480 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize ( OCI_Statement stmt)

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

Definition at line 2524 of file statement.c.

OCI_EXPORT 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.

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

Definition at line 2540 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindShort ( OCI_Statement stmt,
const mtext *  name,
short *  data 
)

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

Definition at line 2559 of file statement.c.

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

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

Definition at line 2576 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort ( OCI_Statement stmt,
const mtext *  name,
unsigned short *  data 
)

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

Definition at line 2594 of file statement.c.

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

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

Definition at line 2611 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindInt ( OCI_Statement stmt,
const mtext *  name,
int *  data 
)

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

Definition at line 2629 of file statement.c.

Referenced by OCI_QueueCreate(), OCI_QueueStart(), OCI_QueueStop(), OCI_QueueTableCreate(), OCI_QueueTableDrop(), and OCI_QueueTablePurge().

OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts ( OCI_Statement stmt,
const mtext *  name,
int *  data,
unsigned int  nbelem 
)

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

Definition at line 2646 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt ( OCI_Statement stmt,
const mtext *  name,
unsigned int *  data 
)

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

Definition at line 2664 of file statement.c.

Referenced by OCI_QueueAlter(), OCI_QueueCreate(), OCI_QueueTableAlter(), OCI_QueueTableCreate(), OCI_QueueTablePurge(), and OCI_ServerEnableOutput().

OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedInts ( OCI_Statement stmt,
const mtext *  name,
unsigned int *  data,
unsigned int  nbelem 
)

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

Definition at line 2681 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindBigInt ( OCI_Statement stmt,
const mtext *  name,
big_int data 
)

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

Definition at line 2699 of file statement.c.

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

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

Definition at line 2716 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt ( OCI_Statement stmt,
const mtext *  name,
big_uint *  data 
)

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

Definition at line 2734 of file statement.c.

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

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

Definition at line 2751 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindString ( OCI_Statement stmt,
const mtext *  name,
dtext *  data,
unsigned int  len 
)

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

Definition at line 2769 of file statement.c.

Referenced by OCI_QueueAlter(), OCI_QueueCreate(), OCI_QueueDrop(), OCI_QueueStart(), OCI_QueueStop(), OCI_QueueTableAlter(), OCI_QueueTableCreate(), OCI_QueueTableDrop(), OCI_QueueTableMigrate(), and OCI_QueueTablePurge().

OCI_EXPORT boolean OCI_API OCI_BindArrayOfStrings ( OCI_Statement stmt,
const mtext *  name,
dtext *  data,
unsigned int  len,
unsigned int  nbelem 
)

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
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
if len <= 0, it returns FALSE
Returns:
TRUE on success otherwise FALSE

Definition at line 2808 of file statement.c.

Referenced by OCI_ServerEnableOutput().

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

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

Definition at line 2829 of file statement.c.

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

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

Definition at line 2849 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindDouble ( OCI_Statement stmt,
const mtext *  name,
double *  data 
)

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

Definition at line 2870 of file statement.c.

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

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

Definition at line 2898 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindFloat ( OCI_Statement stmt,
const mtext *  name,
float *  data 
)

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

Definition at line 2927 of file statement.c.

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

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

Definition at line 2955 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindDate ( OCI_Statement stmt,
const mtext *  name,
OCI_Date data 
)

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

Definition at line 2984 of file statement.c.

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

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

Definition at line 3001 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindTimestamp ( OCI_Statement stmt,
const mtext *  name,
OCI_Timestamp data 
)

Bind a timestamp variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Timestamp handle
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3019 of file statement.c.

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

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

Definition at line 3068 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindInterval ( OCI_Statement stmt,
const mtext *  name,
OCI_Interval data 
)

Bind an interval variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Interval handle
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3120 of file statement.c.

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

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

Definition at line 3164 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindLob ( OCI_Statement stmt,
const mtext *  name,
OCI_Lob data 
)

Bind a Lob variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Lob handle
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3250 of file statement.c.

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

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
Warning:
There is a knwon Oracle bug related to binding array of lob using UTF16 and Oracle 8i clients. Lob contents are badly inserted into database Thus do not use OCI_BindArrayOfLobs with Oracle 8I clients and OCILIB built with OCI_CHARSET_MIXED
Returns:
TRUE on success otherwise FALSE

Definition at line 3280 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindFile ( OCI_Statement stmt,
const mtext *  name,
OCI_File data 
)

Bind a File variable.

Parameters:
stmt- Statement handle
name- Variable name
data- File handle
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3312 of file statement.c.

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

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

Definition at line 3342 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindObject ( OCI_Statement stmt,
const mtext *  name,
OCI_Object data 
)

Bind an object (named type) variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Object handle
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3212 of file statement.c.

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

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

Definition at line 3229 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindColl ( OCI_Statement stmt,
const mtext *  name,
OCI_Coll data 
)

Bind a Collection variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Collection handle to bind
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3410 of file statement.c.

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

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

Definition at line 3427 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindRef ( OCI_Statement stmt,
const mtext *  name,
OCI_Ref data 
)

Bind a Ref variable.

Parameters:
stmt- Statement handle
name- Variable name
data- Ref handle to bind
Note:
parameter 'data' CANNOT be NULL whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3374 of file statement.c.

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

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

Definition at line 3391 of file statement.c.

OCI_EXPORT boolean OCI_API OCI_BindStatement ( OCI_Statement stmt,
const mtext *  name,
OCI_Statement data 
)

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 whatever the statement bind allocation mode
Returns:
TRUE on success otherwise FALSE

Definition at line 3446 of file statement.c.

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

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

Definition at line 3467 of file statement.c.

OCI_EXPORT OCI_Error* OCI_API OCI_GetBatchError ( OCI_Statement stmt)

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

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

Definition at line 4423 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetBatchErrorCount ( OCI_Statement stmt)

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

Parameters:
stmt- Statement handle

Definition at line 4449 of file statement.c.

OCI_EXPORT unsigned int OCI_API OCI_GetBindCount ( OCI_Statement stmt)

Return the number of binds currently associated to a statement.

Parameters:
stmt- Statement handle

Definition at line 4301 of file statement.c.

OCI_EXPORT 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.

Parameters:
stmt- Statement handle
index- Bind position
Note:
Index starts at 1.
Bind handle are created sequentially. By 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

Definition at line 4317 of file statement.c.

Referenced by OCI_ServerEnableOutput().

OCI_EXPORT OCI_Bind* OCI_API OCI_GetBind2 ( OCI_Statement stmt,
const mtext *  name 
)

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

Definition at line 4335 of file statement.c.

OCI_EXPORT const mtext* OCI_API OCI_BindGetName ( OCI_Bind bnd)

Return the name of the given bind.

Parameters:
bnd- Bind handle

Definition at line 491 of file bind.c.

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

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 ouput values
Default value is OCI_BDM_IN_OUT
Returns:
TRUE on success otherwise FALSE

Definition at line 814 of file bind.c.

OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection ( OCI_Bind bnd)

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

Definition at line 835 of file bind.c.

OCI_EXPORT unsigned int OCI_API OCI_BindGetType ( OCI_Bind bnd)

Return the OCILIB type of the given bind.

Parameters:
bnd- Bind handle
Note:
Possible values are :
Returns:
The column type or OCI_CDT_UNKNOWN on error

Definition at line 507 of file bind.c.

OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype ( OCI_Bind bnd)

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

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

Definition at line 523 of file bind.c.

OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount ( OCI_Bind bnd)

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

Definition at line 551 of file bind.c.

OCI_EXPORT void* OCI_API OCI_BindGetData ( OCI_Bind bnd)

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

Definition at line 567 of file bind.c.

OCI_EXPORT OCI_Statement* OCI_API OCI_BindGetStatement ( OCI_Bind bnd)

Return the statement handle associated with a bind handle.

Parameters:
bnd- bind handle

Definition at line 583 of file bind.c.

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

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.

Definition at line 599 of file bind.c.

References OCI_BindSetDataSizeAtPos().

OCI_EXPORT 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.

Parameters:
bnd- bind handle
position- Position in the array
size- data size
Note:
See OCI_BindSetDataSize() for supported datatypes
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.

Definition at line 612 of file bind.c.

Referenced by OCI_BindSetDataSize().

OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSize ( OCI_Bind bnd)

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

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

Definition at line 652 of file bind.c.

References OCI_BindGetDataSizeAtPos().

OCI_EXPORT 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.

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

Definition at line 664 of file bind.c.

Referenced by OCI_BindGetDataSize().

OCI_EXPORT boolean OCI_API OCI_BindSetNull ( OCI_Bind bnd)

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 datatypes (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

Definition at line 722 of file bind.c.

References OCI_BindSetNullAtPos().

Referenced by OCI_ServerEnableOutput().

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

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 datatypes (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

Definition at line 699 of file bind.c.

Referenced by OCI_BindSetNull().

OCI_EXPORT boolean OCI_API OCI_BindIsNull ( OCI_Bind bnd)

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

Definition at line 759 of file bind.c.

References OCI_BindIsNullAtPos().

OCI_EXPORT 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.

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

Definition at line 734 of file bind.c.

Referenced by OCI_BindIsNull().

boolean OCI_API OCI_BindSetCharsetForm ( OCI_Bind bnd,
unsigned int  csfrm 
)

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

Definition at line 771 of file bind.c.