OCILIB (C Driver for Oracle) 3.9.2
Functions
Oracle collections (Varrays and Nested Tables)

Detailed Description

OCILIB supports all Oracle collections:

PL/SQL tables are implemented by binding regular C arrays with the array interface (using OCI_BindArrayOfXXX() calls)

Varrays and Nested tables are implemented in OCILIB with the type OCI_Coll. It's possible to bind and fetch Varrays and Nested tables using OCI_Coll handle.

It's also possible to declare local collections based on some database type without using queries

OCI (and thus OCILIB) offers the possibility to access collection elements :

Collection Items are implemented through the type OCI_Elem and use the series of calls OCI_ElemGetXXX() and OCI_ElemSetXXX() to manipulate elements content values

Example
#include "ocilib.h"

int main(void)
{
    OCI_Connection *cn;
    OCI_Statement *st;
    OCI_Resultset *rs;
    OCI_Coll *coll;
    OCI_Iter *iter;
    OCI_Elem *elem;
    OCI_TypeInfo *type;
    OCI_Object *obj;
    int i, n;

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

    cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);


    /* Varray binding -------------------------------------------------------- */

    st = OCI_StatementCreate(cn);

    /* create the collection */

    type = OCI_TypeInfoGet(cn, "Varray_type", OCI_TIF_TYPE);
    coll = OCI_CollCreate(type);

    /* bind the local collection to a PL/SQL procedure */
    
    OCI_Prepare(st, "begin load_array(:array); end;");
    OCI_BindColl(st, ":array", coll);
    OCI_Execute(st);
 
    /* the procedure has filled the collection and 
       we can iterate it using an iterator */
    
    iter = OCI_IterCreate(coll);
    elem = OCI_IterGetNext(iter);

    while (elem != NULL)
    {
        printf("value %s\n", OCI_ElemGetString(elem));
        elem = OCI_IterGetNext(iter);
    }

    OCI_IterFree(iter);
    OCI_CollFree(coll);
 
    /* Varray SQL fetch ------------------------------------------------------- */
  
    /* query on a table with varray column */
 
    OCI_ExecuteStmt(st, "SELECT * from table_article");

    rs = OCI_GetResultset(st);

    while (OCI_FetchNext(rs))
    {
        /* iterate the collection using an iterator */

        coll = OCI_GetColl(rs, 2);

        iter = OCI_IterCreate(coll);
        elem = OCI_IterGetNext(iter);

        printf("article #%d\n", OCI_GetInt(rs, 1));

        while (elem != NULL)
        {
            obj = OCI_ElemGetObject(elem);
            printf(".... code %d, name%s \n", OCI_ObjectGetInt(obj, "ID"),
                                              OCI_ObjectGetString(obj, "NAME"));
            elem = OCI_IterGetNext(iter);
        }

        OCI_IterFree(iter);
    }

    /* Nested table fetch ------------------------------------------------------- */
    
    /* query on a table with nested table column */
 
    OCI_ExecuteStmt(st, "SELECT * from table_sales");

    rs = OCI_GetResultset(st);

    while (OCI_FetchNext(rs))
    {
        coll = OCI_GetColl(rs, 2);

        printf("Sale #%d\n", OCI_GetInt(rs, 1));

        /* iterate the collection by accessing element by index */
   
        n = OCI_CollGetSize(coll);

        for(i = 1; i <= n; i++)
        {
            elem = OCI_CollGetAt(coll, i);
            obj  = OCI_ElemGetObject(elem);

            printf(".... employee %s, amount %s \n", OCI_ObjectGetString(obj, "EMP"),
                                                     OCI_ObjectGetString(obj, "AMOUNT"));
        }
    }

    OCI_Cleanup();
    
    return EXIT_SUCCESS;
}

Functions

OCI_EXPORT OCI_Coll *OCI_API OCI_CollCreate (OCI_TypeInfo *typinf)
 Create a local collection instance.
OCI_EXPORT boolean OCI_API OCI_CollFree (OCI_Coll *coll)
 Free a local collection.
OCI_EXPORT OCI_Coll **OCI_API OCI_CollArrayCreate (OCI_Connection *con, OCI_TypeInfo *typinf, unsigned int nbelem)
 Create an array of Collection object.
OCI_EXPORT boolean OCI_API OCI_CollArrayFree (OCI_Coll **colls)
 Free an arrray of Collection objects.
OCI_EXPORT boolean OCI_API OCI_CollAssign (OCI_Coll *coll, OCI_Coll *coll_src)
 Assign a collection to another one.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo (OCI_Coll *coll)
 Return the type info object associated to the collection.
OCI_EXPORT unsigned int OCI_API OCI_CollGetType (OCI_Coll *coll)
 Return the collection type.
OCI_EXPORT unsigned int OCI_API OCI_CollGetMax (OCI_Coll *coll)
 Returns the maximum number of elements of the given collection.
OCI_EXPORT unsigned int OCI_API OCI_CollGetSize (OCI_Coll *coll)
 Returns the current number of elements of the given collection.
OCI_EXPORT boolean OCI_API OCI_CollTrim (OCI_Coll *coll, unsigned int nb_elem)
 Trims the given number of elements from the end of the collection.
OCI_EXPORT boolean OCI_API OCI_CollClear (OCI_Coll *coll)
 clear all items of the given collection
OCI_EXPORT OCI_Elem *OCI_API OCI_CollGetAt (OCI_Coll *coll, unsigned int index)
 Return the element at the given position in the collection.
OCI_EXPORT boolean OCI_API OCI_CollGetAt2 (OCI_Coll *coll, unsigned int index, OCI_Elem *elem)
 Return the element at the given position in the collection.
OCI_EXPORT boolean OCI_API OCI_CollSetAt (OCI_Coll *coll, unsigned int index, OCI_Elem *elem)
 Assign the given element value to the element at the given position in the collection.
OCI_EXPORT boolean OCI_API OCI_CollAppend (OCI_Coll *coll, OCI_Elem *elem)
 Append the given element at the end of the collection.
OCI_EXPORT OCI_Iter *OCI_API OCI_IterCreate (OCI_Coll *coll)
 Create an iterator handle to iterate through a collection.
OCI_EXPORT boolean OCI_API OCI_IterFree (OCI_Iter *iter)
 Free an iterator handle.
OCI_EXPORT OCI_Elem *OCI_API OCI_IterGetNext (OCI_Iter *iter)
 Get the next element in the collection.
OCI_EXPORT OCI_Elem *OCI_API OCI_IterGetPrev (OCI_Iter *iter)
 Get the previous element in the collection.
OCI_EXPORT OCI_Elem *OCI_API OCI_ElemCreate (OCI_TypeInfo *typinf)
 Create a local collection element instance based on a collection type descriptor.
OCI_EXPORT boolean OCI_API OCI_ElemFree (OCI_Elem *elem)
 Free a local collection element.
OCI_EXPORT short OCI_API OCI_ElemGetShort (OCI_Elem *elem)
 Return the short value of the given collection element.
OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort (OCI_Elem *elem)
 Return the unsigned short value of the given collection element.
OCI_EXPORT int OCI_API OCI_ElemGetInt (OCI_Elem *elem)
 Return the int value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt (OCI_Elem *elem)
 Return the unsigned int value of the given collection element.
OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt (OCI_Elem *elem)
 Return the big int value of the given collection element.
OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt (OCI_Elem *elem)
 Return the unsigned big int value of the given collection element.
OCI_EXPORT double OCI_API OCI_ElemGetDouble (OCI_Elem *elem)
 Return the Double value of the given collection element.
OCI_EXPORT const dtext *OCI_API OCI_ElemGetString (OCI_Elem *elem)
 Return the String value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRaw (OCI_Elem *elem, void *value, unsigned int len)
 Read the RAW value of the collection element into the given buffer.
OCI_EXPORT OCI_Date *OCI_API OCI_ElemGetDate (OCI_Elem *elem)
 Return the Date value of the given collection element.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ElemGetTimestamp (OCI_Elem *elem)
 Return the Timestamp value of the given collection element.
OCI_EXPORT OCI_Interval *OCI_API OCI_ElemGetInterval (OCI_Elem *elem)
 Return the Interval value of the given collection element.
OCI_EXPORT OCI_Lob *OCI_API OCI_ElemGetLob (OCI_Elem *elem)
 Return the Lob value of the given collection element.
OCI_EXPORT OCI_File *OCI_API OCI_ElemGetFile (OCI_Elem *elem)
 Return the File value of the given collection element.
OCI_EXPORT OCI_Object *OCI_API OCI_ElemGetObject (OCI_Elem *elem)
 Return the object value of the given collection element.
OCI_EXPORT OCI_Coll *OCI_API OCI_ElemGetColl (OCI_Elem *elem)
 Return the collection value of the given collection element.
OCI_EXPORT OCI_Ref *OCI_API OCI_ElemGetRef (OCI_Elem *elem)
 Return the Ref value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetShort (OCI_Elem *elem, short value)
 Set a short value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort (OCI_Elem *elem, unsigned short value)
 Set a unsigned short value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetInt (OCI_Elem *elem, int value)
 Set a int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt (OCI_Elem *elem, unsigned int value)
 Set a unsigned int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt (OCI_Elem *elem, big_int value)
 Set a big int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt (OCI_Elem *elem, big_uint value)
 Set a unsigned big_int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetDouble (OCI_Elem *elem, double value)
 Set a double value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetString (OCI_Elem *elem, const dtext *value)
 Set a string value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetRaw (OCI_Elem *elem, void *value, unsigned int len)
 Set a RAW value to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetDate (OCI_Elem *elem, OCI_Date *value)
 Assign a Date handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp (OCI_Elem *elem, OCI_Timestamp *value)
 Assign a Timestamp handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetInterval (OCI_Elem *elem, OCI_Interval *value)
 Assign an Interval handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetColl (OCI_Elem *elem, OCI_Coll *value)
 Assign a Collection handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetObject (OCI_Elem *elem, OCI_Object *value)
 Assign an Object handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetLob (OCI_Elem *elem, OCI_Lob *value)
 Assign a Lob handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetFile (OCI_Elem *elem, OCI_File *value)
 Assign a File handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemSetRef (OCI_Elem *elem, OCI_Ref *value)
 Assign a Ref handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ElemIsNull (OCI_Elem *elem)
 Check if the collection element value is null.
OCI_EXPORT boolean OCI_API OCI_ElemSetNull (OCI_Elem *elem)
 Set a collection element value to null.

Function Documentation

OCI_EXPORT OCI_Coll* OCI_API OCI_CollCreate ( OCI_TypeInfo typinf)

Create a local collection instance.

Parameters:
typinf- Type info handle of the collection type descriptor
Returns:
Return the collection object handle on success otherwise NULL on failure

Definition at line 119 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollFree ( OCI_Coll coll)

Free a local collection.

Parameters:
coll- Collection handle
Warning:
Only collection created with OCI_CollCreate() should be freed by OCI_CollFree()
Returns:
TRUE on success otherwise FALSE

Definition at line 142 of file collection.c.

References OCI_ElemFree().

Referenced by OCI_ElemFree().

OCI_EXPORT OCI_Coll** OCI_API OCI_CollArrayCreate ( OCI_Connection con,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

Create an array of Collection object.

Parameters:
con- Connection handle
typinf- Object type (type info handle)
nbelem- number of elements in the array
Note:
see OCI_ObjectCreate() for more details
Returns:
Return the Collection handle array on success otherwise NULL on failure

Definition at line 181 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollArrayFree ( OCI_Coll **  colls)

Free an arrray of Collection objects.

Parameters:
colls- Array of Collection objects
Warning:
Only arrays of Collection created with OCI_CollArrayCreate() should be freed by OCI_CollArrayFree()
Returns:
TRUE on success otherwise FALSE

Definition at line 206 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollAssign ( OCI_Coll coll,
OCI_Coll coll_src 
)

Assign a collection to another one.

Parameters:
coll- Destination Collection handle
coll_src- Source Collection handle
Note:
Oracle proceeds to a deep copy of the collection content
Returns:
TRUE on success otherwise FALSE

Definition at line 218 of file collection.c.

Referenced by OCI_ElemSetColl().

OCI_EXPORT OCI_TypeInfo* OCI_API OCI_CollGetTypeInfo ( OCI_Coll coll)

Return the type info object associated to the collection.

Parameters:
coll- Collection handle

Definition at line 490 of file collection.c.

OCI_EXPORT unsigned int OCI_API OCI_CollGetType ( OCI_Coll coll)

Return the collection type.

Parameters:
coll- Collection handle
Note:
Current collection types are:
  • OCI_COLL_VARRAY: Oracle VARRAY
  • OCI_COLL_NESTED_TABLE: Oracle Nested Table
Returns:
Collection type or OCI_UNKNOWN if the collection handle is null

Definition at line 247 of file collection.c.

OCI_EXPORT unsigned int OCI_API OCI_CollGetMax ( OCI_Coll coll)

Returns the maximum number of elements of the given collection.

Parameters:
coll- Collection handle

Definition at line 274 of file collection.c.

OCI_EXPORT unsigned int OCI_API OCI_CollGetSize ( OCI_Coll coll)

Returns the current number of elements of the given collection.

Parameters:
coll- Collection handle

Definition at line 294 of file collection.c.

Referenced by OCI_CollClear(), and OCI_CollTrim().

OCI_EXPORT boolean OCI_API OCI_CollTrim ( OCI_Coll coll,
unsigned int  nb_elem 
)

Trims the given number of elements from the end of the collection.

Parameters:
coll- Collection handle
nb_elem- Number of elements to trim
Returns:
TRUE on success otherwise FALSE

Definition at line 320 of file collection.c.

References OCI_CollGetSize().

Referenced by OCI_CollClear().

OCI_EXPORT boolean OCI_API OCI_CollClear ( OCI_Coll coll)

clear all items of the given collection

Parameters:
coll- Collection handle
Returns:
TRUE on success otherwise FALSE

Definition at line 506 of file collection.c.

References OCI_CollGetSize(), and OCI_CollTrim().

OCI_EXPORT OCI_Elem* OCI_API OCI_CollGetAt ( OCI_Coll coll,
unsigned int  index 
)

Return the element at the given position in the collection.

Parameters:
coll- Collection handle
index- Index of the destination element
Note:
Collection indexes start at position 1.
Up to 3.3.0, the library checked that the input index was fitting into the collection bounds. From 3.3.1, this check has been removed for some internal reasons. An exception will be still thrown in case of out of bounds index but the exception type is now an OCI exception instead of an OCILIB one.
Returns:
Element handle on success otherwise FALSE

Definition at line 351 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollGetAt2 ( OCI_Coll coll,
unsigned int  index,
OCI_Elem elem 
)

Return the element at the given position in the collection.

Parameters:
coll- Collection handle
index- Index of the destination element
elem- Element handle to hold the collection item data
Note:
Collection indexes start at position 1.
Up to 3.3.0, the library checked that the input index was fitting into the collection bounds. From 3.3.1, this check has been removed for some internal reasons. An exception will be still thrown in case of out of bounds index but the exception type is now an OCI exception instead of an OCILIB one.
Returns:
Element handle on success otherwise FALSE

Definition at line 387 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollSetAt ( OCI_Coll coll,
unsigned int  index,
OCI_Elem elem 
)

Assign the given element value to the element at the given position in the collection.

Parameters:
coll- Collection handle
index- Index of the destination element
elem- Source element handle to assign
Note:
Collection indexes start at position 1.
Up to 3.3.0, the library checked that the input index was fitting into the collection bounds. From 3.3.1, this check has been removed for some internal reasons. An exception will be still thrown in case of out of bounds index but the exception type is now an OCI exception instead of an OCILIB one.
Returns:
TRUE on success otherwise FALSE

Definition at line 430 of file collection.c.

OCI_EXPORT boolean OCI_API OCI_CollAppend ( OCI_Coll coll,
OCI_Elem elem 
)

Append the given element at the end of the collection.

Parameters:
coll- Collection handle
elem- Element handle to add
Note:
Returns:
TRUE on success otherwise FALSE

Definition at line 461 of file collection.c.

OCI_EXPORT OCI_Iter* OCI_API OCI_IterCreate ( OCI_Coll coll)

Create an iterator handle to iterate through a collection.

Parameters:
coll- Collection handle
Returns:
Return the iterator handle on success otherwise NULL on failure

Definition at line 46 of file iterator.c.

References OCI_IterFree().

OCI_EXPORT boolean OCI_API OCI_IterFree ( OCI_Iter iter)

Free an iterator handle.

Parameters:
iter- Iterator handle
Returns:
TRUE on success otherwise FALSE

Definition at line 108 of file iterator.c.

References OCI_ElemFree().

Referenced by OCI_IterCreate().

OCI_EXPORT OCI_Elem* OCI_API OCI_IterGetNext ( OCI_Iter iter)

Get the next element in the collection.

Parameters:
iter- Iterator handle
Returns:
TRUE on success otherwise FALSE if:
  • Empty collection
  • Iterator already positioned on the last collection element
  • An error occurred

Definition at line 151 of file iterator.c.

OCI_EXPORT OCI_Elem* OCI_API OCI_IterGetPrev ( OCI_Iter iter)

Get the previous element in the collection.

Parameters:
iter- Iterator handle
Returns:
TRUE on success otherwise FALSE if:
  • Empty collection
  • Iterator already positioned on the first collection element
  • An error occurred

Definition at line 187 of file iterator.c.

OCI_EXPORT OCI_Elem* OCI_API OCI_ElemCreate ( OCI_TypeInfo typinf)

Create a local collection element instance based on a collection type descriptor.

Parameters:
typinf- Type info handle
Returns:
Return the collection element handle on success otherwise NULL on failure

Definition at line 244 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemFree ( OCI_Elem elem)

Free a local collection element.

Parameters:
elem- Element handle
Warning:
Only element created with OCI_ElemCreate() should be freed by OCI_ElemFree()
Returns:
TRUE on success otherwise FALSE

Definition at line 265 of file element.c.

References OCI_CollFree(), OCI_DateFree(), OCI_FileFree(), OCI_IntervalFree(), OCI_LobFree(), OCI_ObjectFree(), OCI_RefFree(), and OCI_TimestampFree().

Referenced by OCI_CollFree(), and OCI_IterFree().

OCI_EXPORT short OCI_API OCI_ElemGetShort ( OCI_Elem elem)

Return the short value of the given collection element.

Parameters:
elem- Element handle
Returns:
Short value or 0 on failure

Definition at line 348 of file element.c.

OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort ( OCI_Elem elem)

Return the unsigned short value of the given collection element.

Parameters:
elem- Element handle
Returns:
Unsigned short value or 0 on failure

Definition at line 364 of file element.c.

OCI_EXPORT int OCI_API OCI_ElemGetInt ( OCI_Elem elem)

Return the int value of the given collection element.

Parameters:
elem- Element handle
Returns:
Int value or 0 on failure

Definition at line 380 of file element.c.

OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt ( OCI_Elem elem)

Return the unsigned int value of the given collection element.

Parameters:
elem- Element handle
Returns:
Unsigned int value or 0 on failure

Definition at line 396 of file element.c.

OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt ( OCI_Elem elem)

Return the big int value of the given collection element.

Parameters:
elem- Element handle
Returns:
Big int value or 0 on failure

Definition at line 412 of file element.c.

OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt ( OCI_Elem elem)

Return the unsigned big int value of the given collection element.

Parameters:
elem- Element handle
Returns:
Unsigned big int value or 0 on failure

Definition at line 428 of file element.c.

OCI_EXPORT double OCI_API OCI_ElemGetDouble ( OCI_Elem elem)

Return the Double value of the given collection element.

Parameters:
elem- Element handle
Returns:
Double value or 0 on failure

Definition at line 444 of file element.c.

OCI_EXPORT const dtext* OCI_API OCI_ElemGetString ( OCI_Elem elem)

Return the String value of the given collection element.

Parameters:
elem- Element handle
Returns:
String value or NULL on failure

Definition at line 460 of file element.c.

OCI_EXPORT unsigned int OCI_API OCI_ElemGetRaw ( OCI_Elem elem,
void *  value,
unsigned int  len 
)

Read the RAW value of the collection element into the given buffer.

Parameters:
elem- Element handle
value- Buffer to store the RAW value
len- Size of the buffer
Returns:
Number of bytes read from the RAW value or 0 on failure

Definition at line 488 of file element.c.

OCI_EXPORT OCI_Date* OCI_API OCI_ElemGetDate ( OCI_Elem elem)

Return the Date value of the given collection element.

Parameters:
elem- Element handle
Returns:
Date handle or NULL on failure

Definition at line 524 of file element.c.

OCI_EXPORT OCI_Timestamp* OCI_API OCI_ElemGetTimestamp ( OCI_Elem elem)

Return the Timestamp value of the given collection element.

Parameters:
elem- Element handle
Returns:
Timestamp handle or NULL on failure

Definition at line 561 of file element.c.

OCI_EXPORT OCI_Interval* OCI_API OCI_ElemGetInterval ( OCI_Elem elem)

Return the Interval value of the given collection element.

Parameters:
elem- Element handle
Returns:
Interval handle or NULL on failure

Definition at line 599 of file element.c.

OCI_EXPORT OCI_Lob* OCI_API OCI_ElemGetLob ( OCI_Elem elem)

Return the Lob value of the given collection element.

Parameters:
elem- Element handle
Returns:
Lob handle or NULL on failure

Definition at line 637 of file element.c.

OCI_EXPORT OCI_File* OCI_API OCI_ElemGetFile ( OCI_Elem elem)

Return the File value of the given collection element.

Parameters:
elem- Element handle
Returns:
File handle or NULL on failure

Definition at line 675 of file element.c.

OCI_EXPORT OCI_Object* OCI_API OCI_ElemGetObject ( OCI_Elem elem)

Return the object value of the given collection element.

Parameters:
elem- Element handle
Returns:
Object handle or NULL on failure

Definition at line 751 of file element.c.

OCI_EXPORT OCI_Coll* OCI_API OCI_ElemGetColl ( OCI_Elem elem)

Return the collection value of the given collection element.

Parameters:
elem- Element handle
Returns:
Collection handle or NULL on failure

Definition at line 788 of file element.c.

OCI_EXPORT OCI_Ref* OCI_API OCI_ElemGetRef ( OCI_Elem elem)

Return the Ref value of the given collection element.

Parameters:
elem- Element handle
Returns:
Ref handle or NULL on failure

Definition at line 713 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetShort ( OCI_Elem elem,
short  value 
)

Set a short value to a collection element.

Parameters:
elem- Element handle
value- Short value
Returns:
TRUE on success otherwise FALSE

Definition at line 826 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort ( OCI_Elem elem,
unsigned short  value 
)

Set a unsigned short value to a collection element.

Parameters:
elem- Element handle
value- Unsigned short value
Returns:
TRUE on success otherwise FALSE

Definition at line 839 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetInt ( OCI_Elem elem,
int  value 
)

Set a int value to a collection element.

Parameters:
elem- Element handle
value- Int value
Returns:
TRUE on success otherwise FALSE

Definition at line 852 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt ( OCI_Elem elem,
unsigned int  value 
)

Set a unsigned int value to a collection element.

Parameters:
elem- Element handle
value- Unsigned int value
Returns:
TRUE on success otherwise FALSE

Definition at line 865 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt ( OCI_Elem elem,
big_int  value 
)

Set a big int value to a collection element.

Parameters:
elem- Element handle
value- big int value
Returns:
TRUE on success otherwise FALSE

Definition at line 878 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt ( OCI_Elem elem,
big_uint  value 
)

Set a unsigned big_int value to a collection element.

Parameters:
elem- Element handle
value- Unsigned big int value
Returns:
TRUE on success otherwise FALSE

Definition at line 891 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetDouble ( OCI_Elem elem,
double  value 
)

Set a double value to a collection element.

Parameters:
elem- Element handle
value- Double value
Returns:
TRUE on success otherwise FALSE

Definition at line 904 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetString ( OCI_Elem elem,
const dtext *  value 
)

Set a string value to a collection element.

Parameters:
elem- Element handle
value- String value
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 917 of file element.c.

References OCI_ElemSetNull().

OCI_EXPORT boolean OCI_API OCI_ElemSetRaw ( OCI_Elem elem,
void *  value,
unsigned int  len 
)

Set a RAW value to a collection element.

Parameters:
elem- Element handle
value- Raw value
len- Size of the raw value
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 951 of file element.c.

References OCI_ElemSetNull().

OCI_EXPORT boolean OCI_API OCI_ElemSetDate ( OCI_Elem elem,
OCI_Date value 
)

Assign a Date handle to a collection element.

Parameters:
elem- Element handle
value- Date Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 991 of file element.c.

References OCI_DateAssign(), and OCI_ElemSetNull().

OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp ( OCI_Elem elem,
OCI_Timestamp value 
)

Assign a Timestamp handle to a collection element.

Parameters:
elem- Element handle
value- Timestamp Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1035 of file element.c.

References OCI_ElemSetNull(), and OCI_TimestampAssign().

OCI_EXPORT boolean OCI_API OCI_ElemSetInterval ( OCI_Elem elem,
OCI_Interval value 
)

Assign an Interval handle to a collection element.

Parameters:
elem- Element handle
value- Interval Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1080 of file element.c.

References OCI_ElemSetNull(), and OCI_IntervalAssign().

OCI_EXPORT boolean OCI_API OCI_ElemSetColl ( OCI_Elem elem,
OCI_Coll value 
)

Assign a Collection handle to a collection element.

Parameters:
elem- Element handle
value- Collection Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1125 of file element.c.

References OCI_CollAssign(), and OCI_ElemSetNull().

OCI_EXPORT boolean OCI_API OCI_ElemSetObject ( OCI_Elem elem,
OCI_Object value 
)

Assign an Object handle to a collection element.

Parameters:
elem- Element handle
value- Object Handle
Warning:
This function assigns a copy of the object to the given attribute. Any further modifications of the object passed as the parameter 'value' will not be reflected to object 's attribute set with this call
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1170 of file element.c.

References OCI_ElemSetNull(), and OCI_ObjectAssign().

OCI_EXPORT boolean OCI_API OCI_ElemSetLob ( OCI_Elem elem,
OCI_Lob value 
)

Assign a Lob handle to a collection element.

Parameters:
elem- Element handle
value- Lob Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1216 of file element.c.

References OCI_ElemSetNull(), and OCI_LobAssign().

OCI_EXPORT boolean OCI_API OCI_ElemSetFile ( OCI_Elem elem,
OCI_File value 
)

Assign a File handle to a collection element.

Parameters:
elem- Element handle
value- File Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1262 of file element.c.

References OCI_ElemSetNull(), and OCI_FileAssign().

OCI_EXPORT boolean OCI_API OCI_ElemSetRef ( OCI_Elem elem,
OCI_Ref value 
)

Assign a Ref handle to a collection element.

Parameters:
elem- Element handle
value- Ref Handle
Note:
passing a null pointer for value calls OCI_ElemSetNull()
Returns:
TRUE on success otherwise FALSE

Definition at line 1308 of file element.c.

References OCI_ElemSetNull(), and OCI_RefAssign().

OCI_EXPORT boolean OCI_API OCI_ElemIsNull ( OCI_Elem elem)

Check if the collection element value is null.

Parameters:
elem- Element handle
Returns:
TRUE if it's null otherwise FALSE

Definition at line 1354 of file element.c.

OCI_EXPORT boolean OCI_API OCI_ElemSetNull ( OCI_Elem elem)

Set a collection element value to null.

Parameters:
elem- Element handle
Returns:
TRUE on success otherwise FALSE

Definition at line 1377 of file element.c.

Referenced by OCI_ElemSetColl(), OCI_ElemSetDate(), OCI_ElemSetFile(), OCI_ElemSetInterval(), OCI_ElemSetLob(), OCI_ElemSetObject(), OCI_ElemSetRaw(), OCI_ElemSetRef(), OCI_ElemSetString(), and OCI_ElemSetTimestamp().