OCILIB (C Driver for Oracle) 3.9.2
|
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', ....
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 :
#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; }
#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; }
#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_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. |
OCI_EXPORT boolean OCI_API OCI_BindArraySetSize | ( | OCI_Statement * | stmt, |
unsigned int | size | ||
) |
Set the input array size for bulk operations.
stmt | - Statement handle |
size | - Array size |
Definition at line 2470 of file statement.c.
OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize | ( | OCI_Statement * | stmt | ) |
Return the current input array size for bulk operations.
stmt | - Statement handle |
Definition at line 2514 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.
stmt | - Statement handle |
value | - Rebinding mode allowed |
Definition at line 2530 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindShort | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
short * | data | ||
) |
Bind an short variable.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to short variable |
Definition at line 2549 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of shorts |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2566 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.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to unsigned short variable |
Definition at line 2584 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of unsigned shorts |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2601 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindInt | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
int * | data | ||
) |
Bind an integer variable.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to int variable |
Definition at line 2619 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of int |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2636 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.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to unsigned int variable |
Definition at line 2654 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of unsigned int |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2671 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.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to big int variable |
Definition at line 2689 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of big int |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2706 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.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to unsigned big int variable |
Definition at line 2724 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of unsigned big int |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2741 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.
stmt | - Statement handle |
name | - Variable name |
data | - String to bind |
len | - Max length of the string (in character without the zero null terminal character) |
Definition at line 2759 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.
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) |
Definition at line 2798 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.
stmt | - Statement handle |
name | - Variable name |
data | - buffer to bind |
len | - Max length of the buffer |
Definition at line 2819 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.
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) |
Definition at line 2839 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindDouble | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
double * | data | ||
) |
Bind a double variable.
stmt | - Statement handle |
name | - Variable name |
data | - Pointer to double variable |
Definition at line 2860 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of double |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2877 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindDate | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Date * | data | ||
) |
Bind a date variable.
stmt | - Statement handle |
name | - Variable name |
data | - Date handle |
Definition at line 2895 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.
stmt | - Statement handle |
name | - Variable name |
data | - Array of date handle |
nbelem | - Number of element in the array (PL/SQL table only) |
Definition at line 2912 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindTimestamp | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Timestamp * | data | ||
) |
Bind a timestamp variable.
stmt | - Statement handle |
name | - Variable name |
data | - Timestamp handle |
Definition at line 2930 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.
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) |
Definition at line 2979 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindInterval | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Interval * | data | ||
) |
Bind an interval variable.
stmt | - Statement handle |
name | - Variable name |
data | - Interval handle |
Definition at line 3031 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.
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) |
Definition at line 3075 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindLob | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Lob * | data | ||
) |
Bind a Lob variable.
stmt | - Statement handle |
name | - Variable name |
data | - Lob handle |
Definition at line 3161 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.
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) |
Definition at line 3191 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindFile | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_File * | data | ||
) |
Bind a File variable.
stmt | - Statement handle |
name | - Variable name |
data | - File handle |
Definition at line 3223 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.
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) |
Definition at line 3253 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.
stmt | - Statement handle |
name | - Variable name |
data | - Object handle |
Definition at line 3123 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.
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) |
Definition at line 3140 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindColl | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Coll * | data | ||
) |
Bind a Collection variable.
stmt | - Statement handle |
name | - Variable name |
data | - Collection handle to bind |
Definition at line 3321 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.
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) |
Definition at line 3338 of file statement.c.
OCI_EXPORT boolean OCI_API OCI_BindRef | ( | OCI_Statement * | stmt, |
const mtext * | name, | ||
OCI_Ref * | data | ||
) |
Bind a Ref variable.
stmt | - Statement handle |
name | - Variable name |
data | - Ref handle to bind |
Definition at line 3285 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.
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) |
Definition at line 3302 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)
stmt | - Statement handle |
name | - Variable name |
data | - Statement handle to bind |
Definition at line 3357 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.
stmt | - Statement handle |
name | - Variable name |
data | - Long handle |
size | - Size of the long buffer in bytes or characters |
Definition at line 3378 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.
stmt | - Statement handle |
Definition at line 4318 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.
stmt | - Statement handle |
Definition at line 4344 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.
stmt | - Statement handle |
Definition at line 4196 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.
stmt | - Statement handle |
index | - Bind position |
Definition at line 4212 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.
stmt | - Statement handle |
name | - Bind variable name |
Definition at line 4230 of file statement.c.
OCI_EXPORT const mtext* OCI_API OCI_BindGetName | ( | OCI_Bind * | bnd | ) |
OCI_EXPORT boolean OCI_API OCI_BindSetDirection | ( | OCI_Bind * | bnd, |
unsigned int | direction | ||
) |
Set the direction mode of a bind handle.
bnd | - Bind handle |
direction | - direction mode |
OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection | ( | OCI_Bind * | bnd | ) |
Get the direction mode of a bind handle.
bnd | - Bind handle |
return the bind direction mode on success otherwise OCI_UNKNWON
OCI_EXPORT unsigned int OCI_API OCI_BindGetType | ( | OCI_Bind * | bnd | ) |
Return the OCILIB type of the given bind.
bnd | - Bind handle |
OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype | ( | OCI_Bind * | bnd | ) |
Return the OCILIB object subtype of the given bind.
bnd | - Bind handle |
This call is valid for the following OCILIB types:
For numeric binds the possible values are:
For OCI_Long type the possible values are:
For OCI_Lob type the possible values are:
For OCI_File type the possible values are:
For OCI_Timestamp type the possible values are:
For OCI_Interval type the possible values are:
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount | ( | OCI_Bind * | bnd | ) |
OCI_EXPORT void* OCI_API OCI_BindGetData | ( | OCI_Bind * | bnd | ) |
OCI_EXPORT OCI_Statement* OCI_API OCI_BindGetStatement | ( | OCI_Bind * | bnd | ) |
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.
bnd | - bind handle |
size | - data size |
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.
bnd | - bind handle |
position | - Position in the array |
size | - data size |
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.
bnd | - bind handle |
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.
bnd | - bind handle |
position | - Position in the array |
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.
bnd | - Bind handle |
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.
bnd | - Bind handle |
position | - Position in the array |
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.
bnd | - Bind handle |
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.
bnd | - Bind handle |
position | - Position in the array |
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.
bnd | - Bind handle |
csfrm | - charset form |