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
#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 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_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. |
Append the given element at the end of the collection.
coll | - Collection handle | |
elem | - Element handle to add |
Definition at line 330 of file collection.c.
References OCI_TypeInfo::cols, OCI_Coll::con, OCI_Connection::err, OCI_Coll::handle, OCI_Elem::handle, OCI_Elem::pind, OCI_Column::type, OCI_Coll::typinf, and OCI_Elem::typinf.
Assign a collection to another one.
coll | - Destination Collection handle | |
coll_src | - Source Collection handle |
Definition at line 157 of file collection.c.
References OCI_TypeInfo::cols, OCI_Coll::con, OCI_Connection::err, OCI_Coll::handle, OCI_Column::icode, and OCI_Coll::typinf.
Referenced by OCI_ElemSetColl(), and OCI_ObjectSetColl().
OCI_EXPORT boolean OCI_API OCI_CollClear | ( | OCI_Coll * | coll | ) |
clear all items of the given collection
coll | - Collection handle |
Definition at line 369 of file collection.c.
References OCI_CollGetSize(), and OCI_CollTrim().
OCI_EXPORT OCI_Coll* OCI_API OCI_CollCreate | ( | OCI_TypeInfo * | typinf | ) |
Create a local collection instance.
typinf | - Type info handle of the collection type descriptor |
Definition at line 104 of file collection.c.
References OCI_TypeInfo::ccode, and OCI_TypeInfo::con.
OCI_EXPORT boolean OCI_API OCI_CollFree | ( | OCI_Coll * | coll | ) |
Free a local collection.
coll | - Collection handle |
Definition at line 124 of file collection.c.
References OCI_TypeInfo::con, OCI_Coll::elem, OCI_Connection::err, OCI_Coll::handle, OCI_Coll::hstate, OCI_Elem::hstate, OCI_ElemFree(), and OCI_Coll::typinf.
Referenced by OCI_ElemFree().
Return the element at the given position in the collection.
coll | - Collection handle | |
index | - Index of the destination element |
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.
Definition at line 271 of file collection.c.
References OCI_Coll::con, OCI_Coll::elem, OCI_Connection::err, OCI_Coll::handle, and OCI_Coll::typinf.
OCI_EXPORT unsigned int OCI_API OCI_CollGetMax | ( | OCI_Coll * | coll | ) |
Returns the maximum number of elements of the given collection.
coll | - Collection handle |
Definition at line 204 of file collection.c.
References OCI_Coll::handle.
OCI_EXPORT unsigned int OCI_API OCI_CollGetSize | ( | OCI_Coll * | coll | ) |
Returns the current number of elements of the given collection.
coll | - Collection handle |
Definition at line 221 of file collection.c.
References OCI_Coll::con, OCI_Connection::err, and OCI_Coll::handle.
Referenced by OCI_CollClear(), and OCI_CollTrim().
OCI_EXPORT unsigned int OCI_API OCI_CollGetType | ( | OCI_Coll * | coll | ) |
Return the collection type.
coll | - Collection handle |
Definition at line 184 of file collection.c.
References OCI_TypeInfo::ccode, and OCI_Coll::typinf.
OCI_EXPORT OCI_TypeInfo* OCI_API OCI_CollGetTypeInfo | ( | OCI_Coll * | coll | ) |
Return the type info object associated to the collection.
coll | - Collection handle |
Definition at line 356 of file collection.c.
References OCI_Coll::typinf.
Assign the given element value to the element at the given position in the collection.
coll | - Collection handle | |
index | - Index of the destination element | |
elem | - Source element handle to assign |
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.
Definition at line 304 of file collection.c.
References OCI_TypeInfo::cols, OCI_Coll::con, OCI_Connection::err, OCI_Coll::handle, OCI_Elem::handle, OCI_Elem::pind, OCI_Column::type, OCI_Coll::typinf, and OCI_Elem::typinf.
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.
coll | - Collection handle | |
nb_elem | - Number of elements to trim |
Definition at line 244 of file collection.c.
References OCI_Coll::con, OCI_Connection::err, OCI_Coll::handle, and OCI_CollGetSize().
Referenced by OCI_CollClear().
OCI_EXPORT OCI_Elem* OCI_API OCI_ElemCreate | ( | OCI_TypeInfo * | typinf | ) |
Create a local collection element instance based on a collection type descriptor.
typinf | - Type info handle |
Definition at line 190 of file element.c.
References OCI_TypeInfo::con.
OCI_EXPORT boolean OCI_API OCI_ElemFree | ( | OCI_Elem * | elem | ) |
Free a local collection element.
elem | - Element handle |
Definition at line 208 of file element.c.
References OCI_Elem::buf, OCI_TypeInfo::cols, OCI_Elem::handle, OCI_Elem::init, OCI_Elem::obj, OCI_CollFree(), OCI_DateFree(), OCI_FileFree(), OCI_IntervalFree(), OCI_LobFree(), OCI_ObjectFree(), OCI_TimestampFree(), OCI_Column::type, and OCI_Elem::typinf.
Referenced by OCI_CollFree(), and OCI_IterFree().
OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt | ( | OCI_Elem * | elem | ) |
Return the collection value of the given collection element.
elem | - Element handle |
Definition at line 691 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
Return the Date value of the given collection element.
elem | - Element handle |
Definition at line 454 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT double OCI_API OCI_ElemGetDouble | ( | OCI_Elem * | elem | ) |
Return the File value of the given collection element.
elem | - Element handle |
Definition at line 589 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT int OCI_API OCI_ElemGetInt | ( | OCI_Elem * | elem | ) |
OCI_EXPORT OCI_Interval* OCI_API OCI_ElemGetInterval | ( | OCI_Elem * | elem | ) |
Return the Interval value of the given collection element.
elem | - Element handle |
Definition at line 521 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
Return the Lob value of the given collection element.
elem | - Element handle |
Definition at line 555 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT OCI_Object* OCI_API OCI_ElemGetObject | ( | OCI_Elem * | elem | ) |
Return the object value of the given collection element.
elem | - Element handle |
Definition at line 657 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
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.
elem | - Element handle | |
value | - Buffer to store the RAW value | |
len | - Size of the buffer |
Definition at line 417 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Connection::err, OCI_Elem::handle, OCI_Column::type, and OCI_Elem::typinf.
Return the Ref value of the given collection element.
elem | - Element handle |
Definition at line 623 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
OCI_EXPORT short OCI_API OCI_ElemGetShort | ( | OCI_Elem * | elem | ) |
OCI_EXPORT const dtext* OCI_API OCI_ElemGetString | ( | OCI_Elem * | elem | ) |
Return the String value of the given collection element.
elem | - Element handle |
Definition at line 391 of file element.c.
References OCI_Elem::buf, OCI_Elem::buflen, OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT OCI_Timestamp* OCI_API OCI_ElemGetTimeStamp | ( | OCI_Elem * | elem | ) |
Return the Timestamp value of the given collection element.
elem | - Element handle |
Definition at line 487 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::ind, OCI_Elem::init, OCI_Elem::obj, OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt | ( | OCI_Elem * | elem | ) |
OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt | ( | OCI_Elem * | elem | ) |
OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort | ( | OCI_Elem * | elem | ) |
OCI_EXPORT boolean OCI_API OCI_ElemIsNull | ( | OCI_Elem * | elem | ) |
Check if the collection element value is null.
elem | - Element handle |
Definition at line 1175 of file element.c.
References OCI_Elem::pind.
OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt | ( | OCI_Elem * | elem, | |
big_int | value | |||
) |
Assign a Collection handle to a collection element.
elem | - Element handle | |
value | - Collection Handle |
Definition at line 977 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_CollAssign(), OCI_ElemSetNull(), OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
Assign a Date handle to a collection element.
elem | - Element handle | |
value | - Date Handle |
Definition at line 860 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_DateAssign(), OCI_ElemSetNull(), OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetDouble | ( | OCI_Elem * | elem, | |
double | value | |||
) |
Assign a File handle to a collection element.
elem | - Element handle | |
value | - File Handle |
Definition at line 1096 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_FileAssign(), OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetInt | ( | OCI_Elem * | elem, | |
int | value | |||
) |
OCI_EXPORT boolean OCI_API OCI_ElemSetInterval | ( | OCI_Elem * | elem, | |
OCI_Interval * | value | |||
) |
Assign an Interval handle to a collection element.
elem | - Element handle | |
value | - Interval Handle |
Definition at line 938 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_IntervalAssign(), OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
Assign a Lob handle to a collection element.
elem | - Element handle | |
value | - Lob Handle |
Definition at line 1057 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_LobAssign(), OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetNull | ( | OCI_Elem * | elem | ) |
Set a collection element value to null.
elem | - Element handle |
Definition at line 1195 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().
OCI_EXPORT boolean OCI_API OCI_ElemSetObject | ( | OCI_Elem * | elem, | |
OCI_Object * | value | |||
) |
Assign an Object handle to a collection element.
elem | - Element handle | |
value | - Object Handle |
Definition at line 1016 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Object::handle, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_ObjectAssign(), OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetRaw | ( | OCI_Elem * | elem, | |
void * | value, | |||
unsigned int | len | |||
) |
Set a RAW value to a collection element.
elem | - Element handle | |
value | - Raw value | |
len | - Size of the raw value |
Definition at line 825 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Connection::err, OCI_Elem::handle, OCI_ElemSetNull(), OCI_Column::type, and OCI_Elem::typinf.
Assign a Ref handle to a collection element.
elem | - Element handle | |
value | - Ref Handle |
Definition at line 1136 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_RefAssign(), OCI_Column::type, OCI_Column::typinf, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetShort | ( | OCI_Elem * | elem, | |
short | value | |||
) |
OCI_EXPORT boolean OCI_API OCI_ElemSetString | ( | OCI_Elem * | elem, | |
const dtext * | value | |||
) |
Set a string value to a collection element.
elem | - Element handle | |
value | - String value |
Definition at line 795 of file element.c.
References OCI_Elem::buf, OCI_Elem::buflen, OCI_TypeInfo::cols, OCI_Elem::con, OCI_Connection::err, OCI_Elem::handle, OCI_ElemSetNull(), OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp | ( | OCI_Elem * | elem, | |
OCI_Timestamp * | value | |||
) |
Assign a Timestamp handle to a collection element.
elem | - Element handle | |
value | - Timestamp Handle |
Definition at line 899 of file element.c.
References OCI_TypeInfo::cols, OCI_Elem::con, OCI_Elem::handle, OCI_Elem::obj, OCI_ElemSetNull(), OCI_TimestampAssign(), OCI_Column::subtype, OCI_Column::type, and OCI_Elem::typinf.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt | ( | OCI_Elem * | elem, | |
big_uint | value | |||
) |
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt | ( | OCI_Elem * | elem, | |
unsigned int | value | |||
) |
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort | ( | OCI_Elem * | elem, | |
unsigned short | value | |||
) |
Create an iterator handle to iterate through a collection.
coll | - Collection handle |
Definition at line 45 of file iterator.c.
References OCI_Iter::boc, OCI_Iter::coll, OCI_Coll::con, OCI_Iter::elem, OCI_Iter::eoc, OCI_Connection::err, OCI_Iter::handle, OCI_Coll::handle, OCI_IterFree(), and OCI_Coll::typinf.
OCI_EXPORT boolean OCI_API OCI_IterFree | ( | OCI_Iter * | iter | ) |
Free an iterator handle.
iter | - Iterator handle |
Definition at line 104 of file iterator.c.
References OCI_Iter::coll, OCI_Coll::con, OCI_Iter::elem, OCI_Connection::err, OCI_Iter::handle, and OCI_ElemFree().
Referenced by OCI_IterCreate().
Get the next element in the collection.
iter | - Iterator handle |
Definition at line 143 of file iterator.c.
References OCI_Iter::coll, OCI_Coll::con, OCI_Iter::elem, OCI_Iter::eoc, OCI_Connection::err, OCI_Elem::handle, OCI_Iter::handle, OCI_Elem::ind, OCI_Elem::init, and OCI_Elem::pind.
Get the previous element in the collection.
iter | - Iterator handle |
Definition at line 178 of file iterator.c.
References OCI_Iter::boc, OCI_Iter::coll, OCI_Coll::con, OCI_Iter::elem, OCI_Connection::err, OCI_Elem::handle, OCI_Iter::handle, OCI_Elem::ind, OCI_Elem::init, and OCI_Elem::pind.