Binding variables and arrays
C API

## Detailed Description

OCILIB supports OCI data binding APIs

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

- Provide input data for SQL statement
- Provide input/output data for PL/SQL blocks

OCILIB provides a set of binding functions to use with:

- Basic data types: string (char/wchar_t *), int, float, double, raw
- Object data types: lobs, files,longs, dates, cursors, statements, timestamps, intervals, objects

To use binding:

- Prepare a statement with OCI_Prepare() (see Executing statements)
- Bind variables by calling one if the OCI_Bindxxxxx() function for every input variable referenced by the SQL statement
- Setup up values of the program variables
- Call OCI_Execute() as many times as needed
- Each OCI_Execute() call may be preceded by an update of the program variables (for INSERTs for example)

Bindings can be:

- IN (host variable are not used anymore after statement execution)
- OUT (host variable are set during statement execution)
- IN/OUT (default) Use OCI_BindSetDirectionTo() to change a host variable bind direction mode after the binding call but before statement execution. Note that each direction mode may have a little overhead depending on the SQL type as OCILIB may have to do checks/conversions/mappings between host variable and buffers. Thus, to maximize performances:
- set direction mode to OCI_BDM_IN if host variable is not updated by statement execution
- set direction mode to OCI_BDM_OUT if host variable value does not matter prior to statement execution
- set direction mode to OCI_BDM_IN_OUT when host variable value is used for execution and updated by statement execution

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

- all types supported the library can be used for array binding except OCI_Statement and OCI_Long
- Array binding is really fast for massive DML operations
- For string/RAW arrays, the input array MUST BE a contiguous block of data and not an array of pointers. So to bind an array of 10 elements for a varchar2(30) column, binded variable must be a like array[10][31]

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:

- by name (default mode in OCILIB): Oracle looks for variables in the SQL statement by searching their names provided to the binding function. So a variable can be binded once and used many times in the statement
- by position: Oracle binds variables by position, so every variable is binded with a position number

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 :

- minimize the amount of program variables
- optimize internal memory management for arrays

To do so :

- Call OCI_SetBindAllocation() with the mode OCI_BAM_INTERNAL
- pass a NULL variable or array to OCI_BindXXX() calls
- Retrieve the bind content allocated by OCILIB with OCI_BindGetData()

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 :

- OCI_BindTimestamp()
- OCI_BindInterval()
- OCI_BindLob()
- OCI_BindFile()
- OCI_BindObject()
- OCI_BindColl()
- OCI_BindRef()
- OCI_BindStatement()
- OCI_BindLong()

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 */
  OCI_Connection *cn;
  OCI_Statement *st;
  int code;
  void err_handler(OCI_Error *err)
  {
  printf("%s\n", OCI_ErrorGetString(err));
  }
  void get_product_name(int requested_code)
  {
  OCI_Resultset *rs;
  code = requested_code;
  OCI_Execute(st);
  rs = OCI_GetResultset(st);
  OCI_FetchNext(rs);
  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);
  st = OCI_StatementCreate(cn);
  OCI_Prepare(st, "select name from products where code = :code");
  OCI_BindInt(st, ":code", &code);
  get_product_name(1);
  get_product_name(2);
  OCI_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

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_Connection *cn;
  OCI_Statement *st;
  OCI_Error *err;
  int tab_int[ARRAY_SIZE];
  char tab_str[ARRAY_SIZE][STRING_SIZE];
  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);
  st = OCI_StatementCreate(cn);
  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<1000; 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));
  OCI_StatementFree(st);
  OCI_ConnectionFree(cn);
  OCI_Cleanup();
  return EXIT_SUCCESS;
  }

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_Connection *cn;
  OCI_Statement *st;
  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);
  st = OCI_StatementCreate(cn);
  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);
  tab = (OCI_Date **)OCI_BindGetData(OCI_GetBind(st, 1));
  for (i = 0; i < ARRAY_SIZE; i++)
  {
  OCI_DateSysDate(tab[i]);
  }
  OCI_Execute(st);
  printf("row inserted : %d\n", OCI_GetAffectedRows(st));
  OCI_StatementFree(st);
  OCI_ConnectionFree(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. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindArrayGetSize (OCI_Statement *stmt)
| Return the current input array size for bulk operations. More...
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. More...
OCI_EXPORT boolean OCI_API | OCI_IsRebindingAllowed (OCI_Statement *stmt)
| Indicate if rebinding is allowed on the given statement. More...
OCI_EXPORT boolean OCI_API | OCI_BindBoolean (OCI_Statement *stmt, const otext *name, boolean *data)
| Bind a boolean variable (PL/SQL ONLY) More...
OCI_EXPORT boolean OCI_API | OCI_BindNumber (OCI_Statement *stmt, const otext *name, OCI_Number *data)
| Bind an Number variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfNumbers (OCI_Statement *stmt, const otext *name, OCI_Number **data, unsigned int nbelem)
| Bind an array of Number. More...
OCI_EXPORT boolean OCI_API | OCI_BindShort (OCI_Statement *stmt, const otext *name, short *data)
| Bind an short variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfShorts (OCI_Statement *stmt, const otext *name, short *data, unsigned int nbelem)
| Bind an array of shorts. More...
OCI_EXPORT boolean OCI_API | OCI_BindUnsignedShort (OCI_Statement *stmt, const otext *name, unsigned short *data)
| Bind an unsigned short variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfUnsignedShorts (OCI_Statement *stmt, const otext *name, unsigned short *data, unsigned int nbelem)
| Bind an array of unsigned shorts. More...
OCI_EXPORT boolean OCI_API | OCI_BindInt (OCI_Statement *stmt, const otext *name, int *data)
| Bind an integer variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfInts (OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
| Bind an array of integers. More...
OCI_EXPORT boolean OCI_API | OCI_BindUnsignedInt (OCI_Statement *stmt, const otext *name, unsigned int *data)
| Bind an unsigned integer variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfUnsignedInts (OCI_Statement *stmt, const otext *name, unsigned int *data, unsigned int nbelem)
| Bind an array of unsigned integers. More...
OCI_EXPORT boolean OCI_API | OCI_BindBigInt (OCI_Statement *stmt, const otext *name, big_int *data)
| Bind a big integer variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfBigInts (OCI_Statement *stmt, const otext *name, big_int *data, unsigned int nbelem)
| Bind an array of big integers. More...
OCI_EXPORT boolean OCI_API | OCI_BindUnsignedBigInt (OCI_Statement *stmt, const otext *name, big_uint *data)
| Bind an unsigned big integer variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfUnsignedBigInts (OCI_Statement *stmt, const otext *name, big_uint *data, unsigned int nbelem)
| Bind an array of unsigned big integers. More...
OCI_EXPORT boolean OCI_API | OCI_BindString (OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
| Bind a string variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfStrings (OCI_Statement *stmt, const otext *name, otext *data, unsigned int len, unsigned int nbelem)
| Bind an array of strings. More...
OCI_EXPORT boolean OCI_API | OCI_BindRaw (OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
| Bind a raw buffer. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindDouble (OCI_Statement *stmt, const otext *name, double *data)
| Bind a double variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfDoubles (OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
| Bind an array of doubles. More...
OCI_EXPORT boolean OCI_API | OCI_BindFloat (OCI_Statement *stmt, const otext *name, float *data)
| Bind a float variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfFloats (OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
| Bind an array of floats. More...
OCI_EXPORT boolean OCI_API | OCI_BindDate (OCI_Statement *stmt, const otext *name, OCI_Date *data)
| Bind a date variable. More...
OCI_EXPORT boolean OCI_API | OCI_BindArrayOfDates (OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
| Bind an array of dates. More...
OCI_EXPORT boolean OCI_API | OCI_BindTimestamp (OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
| Bind a timestamp variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindInterval (OCI_Statement *stmt, const otext *name, OCI_Interval *data)
| Bind an interval variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindLob (OCI_Statement *stmt, const otext *name, OCI_Lob *data)
| Bind a Lob variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindFile (OCI_Statement *stmt, const otext *name, OCI_File *data)
| Bind a File variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindObject (OCI_Statement *stmt, const otext *name, OCI_Object *data)
| Bind an object (named type) variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindColl (OCI_Statement *stmt, const otext *name, OCI_Coll *data)
| Bind a Collection variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindRef (OCI_Statement *stmt, const otext *name, OCI_Ref *data)
| Bind a Ref variable. More...
OCI_EXPORT 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. More...
OCI_EXPORT boolean OCI_API | OCI_BindStatement (OCI_Statement *stmt, const otext *name, OCI_Statement *data)
| Bind a Statement variable (PL/SQL Ref Cursor) More...
OCI_EXPORT boolean OCI_API | OCI_BindLong (OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
| Bind a Long variable. More...
OCI_EXPORT OCI_Error *OCI_API | OCI_GetBatchError (OCI_Statement *stmt)
| Returns the first or next error that occurred within a DML array statement execution. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetBatchErrorCount (OCI_Statement *stmt)
| Returns the number of errors that occurred within the last DML array statement. More...
OCI_EXPORT unsigned int OCI_API | OCI_GetBindCount (OCI_Statement *stmt)
| Return the number of binds currently associated to a statement. More...
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. More...
OCI_EXPORT OCI_Bind *OCI_API | OCI_GetBind2 (OCI_Statement *stmt, const otext *name)
| Return a bind handle from its name. More...
OCI_EXPORT 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. More...
OCI_EXPORT const otext *OCI_API | OCI_BindGetName (OCI_Bind *bnd)
| Return the name of the given bind. More...
OCI_EXPORT boolean OCI_API | OCI_BindSetDirection (OCI_Bind *bnd, unsigned int direction)
| Set the direction mode of a bind handle. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetDirection (OCI_Bind *bnd)
| Get the direction mode of a bind handle. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetType (OCI_Bind *bnd)
| Return the OCILIB type of the given bind. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetSubtype (OCI_Bind *bnd)
| Return the OCILIB object subtype of the given bind. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetDataCount (OCI_Bind *bnd)
| Return the number of elements of the bind handle. More...
OCI_EXPORT void *OCI_API | OCI_BindGetData (OCI_Bind *bnd)
| Return the user defined data associated with a bind handle. More...
OCI_EXPORT OCI_Statement *OCI_API | OCI_BindGetStatement (OCI_Bind *bnd)
| Return the statement handle associated with a bind handle. More...
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. More...
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. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetDataSize (OCI_Bind *bnd)
| Return the actual size of the element held by the given bind handle. More...
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. More...
OCI_EXPORT boolean OCI_API | OCI_BindSetNull (OCI_Bind *bnd)
| Set the bind variable to null. More...
OCI_EXPORT boolean OCI_API | OCI_BindSetNullAtPos (OCI_Bind *bnd, unsigned int position)
| Set to null the entry in the bind variable input array. More...
OCI_EXPORT boolean OCI_API | OCI_BindSetNotNull (OCI_Bind *bnd)
| Set the bind variable to NOT null. More...
OCI_EXPORT boolean OCI_API | OCI_BindSetNotNullAtPos (OCI_Bind *bnd, unsigned int position)
| Set to NOT null the entry in the bind variable input array. More...
OCI_EXPORT boolean OCI_API | OCI_BindIsNull (OCI_Bind *bnd)
| Check if the current value of the binded variable is marked as NULL. More...
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. More...
boolean OCI_API | OCI_BindSetCharsetForm (OCI_Bind *bnd, unsigned int csfrm)
| Set the charset form of the given character based bind variable. More...
OCI_EXPORT unsigned int OCI_API | OCI_BindGetAllocationMode (OCI_Bind *bnd)
| Get the allocaton mode of a bind handle. More...

## Function Documentation

## OCI_BindArraySetSize()

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

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_BindArrayGetSize | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.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(), and ocilib::Long< T, U >::GetLength().

## OCI_AllowRebinding()

OCI_EXPORT boolean OCI_API OCI_AllowRebinding | ( | OCI_Statement * | stmt,
|  | boolean | value
| ) |  |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_IsRebindingAllowed | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.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::Long< T, U >::GetLength(), and ocilib::Statement::IsRebindingAllowed().

## OCI_BindBoolean()

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

`#include <ocilib.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

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

## OCI_BindNumber()

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

`#include <ocilib.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

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

## OCI_BindArrayOfNumbers()

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

`#include <ocilib.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

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

## OCI_BindShort()

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

`#include <ocilib.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

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

## OCI_BindArrayOfShorts()

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

`#include <ocilib.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

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

## OCI_BindUnsignedShort()

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

`#include <ocilib.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

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

## OCI_BindArrayOfUnsignedShorts()

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

`#include <ocilib.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

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

## OCI_BindInt()

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

`#include <ocilib.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

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

## OCI_BindArrayOfInts()

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

`#include <ocilib.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

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

## OCI_BindUnsignedInt()

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

`#include <ocilib.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

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

## OCI_BindArrayOfUnsignedInts()

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

`#include <ocilib.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

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

## OCI_BindBigInt()

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

`#include <ocilib.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

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

## OCI_BindArrayOfBigInts()

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

`#include <ocilib.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

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

## OCI_BindUnsignedBigInt()

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

`#include <ocilib.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

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

## OCI_BindArrayOfUnsignedBigInts()

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

`#include <ocilib.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

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

## OCI_BindString()

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

`#include <ocilib.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

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

## OCI_BindArrayOfStrings()

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

`#include <ocilib.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

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

## OCI_BindRaw()

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

`#include <ocilib.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

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

## OCI_BindArrayOfRaws()

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

`#include <ocilib.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

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

## OCI_BindDouble()

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

`#include <ocilib.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

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

## OCI_BindArrayOfDoubles()

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

`#include <ocilib.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

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

## OCI_BindFloat()

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

`#include <ocilib.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

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

## OCI_BindArrayOfFloats()

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

`#include <ocilib.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

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

## OCI_BindDate()

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

`#include <ocilib.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

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

## OCI_BindArrayOfDates()

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

`#include <ocilib.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

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

## OCI_BindTimestamp()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfTimestamps()

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

`#include <ocilib.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

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

## OCI_BindInterval()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfIntervals()

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

`#include <ocilib.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

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

## OCI_BindLob()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfLobs()

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

`#include <ocilib.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

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

## OCI_BindFile()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfFiles()

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

`#include <ocilib.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

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

## OCI_BindObject()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfObjects()

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

`#include <ocilib.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

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

## OCI_BindColl()

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

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfColls()

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

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindRef | ( | OCI_Statement * | stmt,
|  | const otext * | name,
|  | OCI_Ref * | data
| ) |  |

`#include <ocilib.h>`

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

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

## OCI_BindArrayOfRefs()

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

`#include <ocilib.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

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

## OCI_BindStatement()

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

`#include <ocilib.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 whatever the statement bind allocation mode

Returns
  TRUE on success otherwise FALSE

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

## OCI_BindLong()

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

`#include <ocilib.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

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

## OCI_GetBatchError()

OCI_EXPORT OCI_Error* OCI_API OCI_GetBatchError | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_GetBatchErrorCount | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.h>`

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

Parameters

  stmt | - Statement handle

## OCI_GetBindCount()

OCI_EXPORT unsigned int OCI_API OCI_GetBindCount | ( | OCI_Statement * | stmt | ) |

`#include <ocilib.h>`

Return the number of binds currently associated to a statement.

Parameters

  stmt | - Statement handle

Referenced by ocilib::Statement::GetBatchErrors(), and ocilib::Statement::GetBindCount().

## OCI_GetBind()

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

`#include <ocilib.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::GetBatchErrors(), and ocilib::Statement::GetBind().

## OCI_GetBind2()

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

`#include <ocilib.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(), and ocilib::Long< T, U >::GetLength().

## OCI_GetBindIndex()

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

`#include <ocilib.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_EXPORT const otext* OCI_API OCI_BindGetName | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.h>`

Return the name of the given bind.

Parameters

  bnd | - Bind handle

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

## OCI_BindSetDirection()

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

`#include <ocilib.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

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

## OCI_BindGetDirection()

OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_BindGetType | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_BindGetSubtype | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_BindGetDataCount | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT void* OCI_API OCI_BindGetData | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT OCI_Statement* OCI_API OCI_BindGetStatement | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.h>`

Return the statement handle associated with a bind handle.

Parameters

  bnd | - bind handle

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

## OCI_BindSetDataSize()

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

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindSetDataSizeAtPos | ( | OCI_Bind * | bnd,
|  | unsigned int | position,
|  | unsigned int | size
| ) |  |

`#include <ocilib.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.

Referenced by ocilib::Long< T, U >::GetLength().

## OCI_BindGetDataSize()

OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSize | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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.

Referenced by ocilib::Long< T, U >::GetLength().

## OCI_BindGetDataSizeAtPos()

OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSizeAtPos | ( | OCI_Bind * | bnd,
|  | unsigned int | position
| ) |  |

`#include <ocilib.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.

Referenced by ocilib::Long< T, U >::GetLength().

## OCI_BindSetNull()

OCI_EXPORT boolean OCI_API OCI_BindSetNull | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindSetNullAtPos | ( | OCI_Bind * | bnd,
|  | unsigned int | position
| ) |  |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindSetNotNull | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindSetNotNullAtPos | ( | OCI_Bind * | bnd,
|  | unsigned int | position
| ) |  |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindIsNull | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.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_EXPORT boolean OCI_API OCI_BindIsNullAtPos | ( | OCI_Bind * | bnd,
|  | unsigned int | position
| ) |  |

`#include <ocilib.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()

boolean OCI_API OCI_BindSetCharsetForm | ( | OCI_Bind * | bnd,
|  | unsigned int | csfrm
| ) |  |

`#include <ocilib.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_EXPORT unsigned int OCI_API OCI_BindGetAllocationMode | ( | OCI_Bind * | bnd | ) |

`#include <ocilib.h>`

Get the allocaton 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 allocaton mode on success otherwise OCI_UNKNWON