OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
Oracle Named Types (Oracle OBJECTs)

Detailed Description

OcilibCApiTimestamps

OCILIB implements Oracle Named types (user types and built-in types) through the OCI_Object type.

OTT and C structures are not required to use objects in OCILIB.

In order to manipulate objects attributes, OCILIB proposes a set of functions to get/set properties for various supported types.

Objects can be:

References (Oracle type REF) are identifiers (smart pointers) to objects and are implemented in OCILIB with the type OCI_Ref.

OCILIB implements Oracle REFs as strong typed Reference (underlying OCI REFs are weaker in terms of typing). It means it's mandatory to provide type information to:

Note
See Oracle Database SQL Language Reference for more details about REF data type
Warning
Prior to v3.5.0, OCILIB relied on some OCI routines to set/get objects attributes. these OCI calls had known bugs in Unicode mode that has been fixed in Oracle 11gR2. From v3.5.0, OCILIB directly sets objects attributes and thus OCILIB objects can now be used in Unicode mode.
Example : Inserting a local object into a table
#include "ocilib.h"
/* requires script demo/object.sql */
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
int main(void)
{
OCI_Object *sale, *vendor;
OCI_Date *date;
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
date = OCI_DateCreate(NULL);
vendor = OCI_ObjectCreate(cn, OCI_TypeInfoGet(cn, "t_vendor", OCI_TIF_TYPE));
OCI_ObjectSetInt(vendor, "CODE", 134);
OCI_ObjectSetString(vendor, "NAME", "JOHN SMITH");
sale = OCI_ObjectCreate(cn, OCI_TypeInfoGet(cn, "t_sale", OCI_TIF_TYPE));
OCI_ObjectSetInt(sale, "CODE", 1);
OCI_ObjectSetDouble(sale, "PRICE", 12.99);
OCI_ObjectSetString(sale, "NAME", "USB KEY 2go");
OCI_ObjectSetString(sale, "REF", "A56547WSAA");
OCI_ObjectSetObject(sale, "VENDOR", vendor);
OCI_ObjectSetDate(sale, "DATE_SALE", date);
OCI_Prepare(st, "insert into sales values(:sale)");
OCI_BindObject(st, ":sale", sale);
printf("\n%d row(s) inserted\n", OCI_GetAffectedRows(st));
OCI_ObjectFree(vendor);
OCI_ExecuteStmt(st, "select * from sales");
rs = OCI_GetResultset(st);
while (OCI_FetchNext(rs))
{
sale = OCI_GetObject(rs, 1);
vendor = OCI_ObjectGetObject(sale, "VENDOR");
printf("Sale %d - %s vendor %s\n", OCI_ObjectGetInt(sale, "CODE"), OCI_ObjectGetString(sale, "NAME"), OCI_ObjectGetString(vendor, "NAME"));
}
return EXIT_SUCCESS;
}
OCI_SYM_PUBLIC boolean OCI_API OCI_BindObject(OCI_Statement *stmt, const otext *name, OCI_Object *data)
Bind an object (named type) variable.
OCI_SYM_PUBLIC boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:124
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: types.h:309
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:136
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: types.h:279
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: types.h:390
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_DateCreate(OCI_Connection *con)
Create a local date object.
OCI_SYM_PUBLIC boolean OCI_API OCI_DateSysDate(OCI_Date *date)
Return the current system date/time into the date handle.
OCI_SYM_PUBLIC const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve error message from error handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
OCI_SYM_PUBLIC OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_GetObject(OCI_Resultset *rs, unsigned int index)
Return the current Object value of the column at the given index in the resultset.
OCI_SYM_PUBLIC boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
OCI_SYM_PUBLIC boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_TypeInfoGet(OCI_Connection *con, const otext *name, unsigned int type)
Retrieve the available type info information.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and Execute a SQL statement or PL/SQL block.
OCI_SYM_PUBLIC boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
OCI_SYM_PUBLIC boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
OCI_SYM_PUBLIC boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetString(OCI_Object *obj, const otext *attr, const otext *value)
Set an object attribute of type string.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectFree(OCI_Object *obj)
Free a local object.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDouble(OCI_Object *obj, const otext *attr, double value)
Set an object attribute of type double.
OCI_SYM_PUBLIC int OCI_API OCI_ObjectGetInt(OCI_Object *obj, const otext *attr)
Return the integer value of the given object attribute.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetInt(OCI_Object *obj, const otext *attr, int value)
Set an object attribute of type int.
OCI_SYM_PUBLIC const otext *OCI_API OCI_ObjectGetString(OCI_Object *obj, const otext *attr)
Return the string value of the given object attribute.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectGetObject(OCI_Object *obj, const otext *attr)
Return the object value of the given object attribute.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetObject(OCI_Object *obj, const otext *attr, OCI_Object *value)
Set an object attribute of type Object.
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDate(OCI_Object *obj, const otext *attr, OCI_Date *value)
Set an object attribute of type Date.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local object instance.
Example : Using Object References
#include "ocilib.h"
/* requires script demo/ref.sql */
#define SIZE_STR 100
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
void dump_ref(OCI_Ref *ref)
{
OCI_Object *vendor;
char data[SIZE_STR + 1];
/* print ref hexadecimal value */
OCI_RefToText(ref, SIZE_STR, data);
printf("...Ref Hex value : %s\n", data);
/* get object from ref */
vendor = OCI_RefGetObject(ref);
/* print object values */
printf("...%i - %s\n", OCI_ObjectGetInt(vendor, "code"), OCI_ObjectGetString(vendor, "name"));
}
int main(void)
{
OCI_Ref *ref;
if (!OCI_Initialize(err_handler, NULL, OCI_ENV_DEFAULT))
{
return EXIT_FAILURE;
}
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
OCI_ExecuteStmt(st, "select ref(v) from vendors v");
rs = OCI_GetResultset(st);
printf("\n\n=> fetch refs from object table\n\n");
while (OCI_FetchNext(rs))
{
dump_ref(OCI_GetRef(rs, 1));
}
printf("\n\n=> bind a local ref object to a PL/SQL statement\n\n");
ref = OCI_RefCreate(cn, OCI_TypeInfoGet(cn, "vendor_t", OCI_TIF_TYPE));
OCI_Prepare(st, "begin select ref(v) into :vendor from vendors v where v.code = 1; end; ");
OCI_BindRef(st, ":vendor", ref);
dump_ref(ref);
return EXIT_SUCCESS;
}
OCI_SYM_PUBLIC boolean OCI_API OCI_BindRef(OCI_Statement *stmt, const otext *name, OCI_Ref *data)
Bind a Ref variable.
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: types.h:356
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_GetRef(OCI_Resultset *rs, unsigned int index)
Return the current Ref value of the column at the given index in the resultset.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_RefGetObject(OCI_Ref *ref)
Returns the object pointed by the Ref handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_RefFree(OCI_Ref *ref)
Free a local Ref.
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_RefCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local Ref instance.
OCI_SYM_PUBLIC boolean OCI_API OCI_RefToText(OCI_Ref *ref, unsigned int size, otext *str)
Converts a Ref handle value to a hexadecimal string.

Functions

OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectCreate (OCI_Connection *con, OCI_TypeInfo *typinf)
 Create a local object instance.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectFree (OCI_Object *obj)
 Free a local object.
 
OCI_SYM_PUBLIC OCI_Object **OCI_API OCI_ObjectArrayCreate (OCI_Connection *con, OCI_TypeInfo *typinf, unsigned int nbelem)
 Create an array of Object objects.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectArrayFree (OCI_Object **objs)
 Free an array of Object objects.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectAssign (OCI_Object *obj, OCI_Object *obj_src)
 Assign an object to another one.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetType (OCI_Object *obj)
 Return the type of an object instance.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetSelfRef (OCI_Object *obj, OCI_Ref *ref)
 Retrieve an Oracle Ref handle from an object and assign it to the given OCILIB OCI_Ref handle.
 
OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_ObjectGetTypeInfo (OCI_Object *obj)
 Return the type info object associated to the object.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetBoolean (OCI_Object *obj, const otext *attr)
 Return the boolean value of the given object attribute (ONLY for PL/SQL records)
 
OCI_SYM_PUBLIC OCI_Number *OCI_API OCI_ObjectGetNumber (OCI_Object *obj, const otext *attr)
 Return the number value of the given object attribute.
 
OCI_SYM_PUBLIC short OCI_API OCI_ObjectGetShort (OCI_Object *obj, const otext *attr)
 Return the short value of the given object attribute.
 
OCI_SYM_PUBLIC unsigned short OCI_API OCI_ObjectGetUnsignedShort (OCI_Object *obj, const otext *attr)
 Return the unsigned short value of the given object attribute.
 
OCI_SYM_PUBLIC int OCI_API OCI_ObjectGetInt (OCI_Object *obj, const otext *attr)
 Return the integer value of the given object attribute.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetUnsignedInt (OCI_Object *obj, const otext *attr)
 Return the unsigned integer value of the given object attribute.
 
OCI_SYM_PUBLIC big_int OCI_API OCI_ObjectGetBigInt (OCI_Object *obj, const otext *attr)
 Return the big integer value of the given object attribute.
 
OCI_SYM_PUBLIC big_uint OCI_API OCI_ObjectGetUnsignedBigInt (OCI_Object *obj, const otext *attr)
 Return the unsigned big integer value of the given object attribute.
 
OCI_SYM_PUBLIC double OCI_API OCI_ObjectGetDouble (OCI_Object *obj, const otext *attr)
 Return the double value of the given object attribute.
 
OCI_SYM_PUBLIC float OCI_API OCI_ObjectGetFloat (OCI_Object *obj, const otext *attr)
 Return the float value of the given object attribute.
 
OCI_SYM_PUBLIC const otext *OCI_API OCI_ObjectGetString (OCI_Object *obj, const otext *attr)
 Return the string value of the given object attribute.
 
OCI_SYM_PUBLIC int OCI_API OCI_ObjectGetRaw (OCI_Object *obj, const otext *attr, void *value, unsigned int len)
 Return the raw attribute value of the given object attribute into the given buffer.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetRawSize (OCI_Object *obj, const otext *attr)
 Return the raw attribute value size of the given object attribute into the given buffer.
 
OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_ObjectGetDate (OCI_Object *obj, const otext *attr)
 Return the date value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_ObjectGetTimestamp (OCI_Object *obj, const otext *attr)
 Return the timestamp value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Interval *OCI_API OCI_ObjectGetInterval (OCI_Object *obj, const otext *attr)
 Return the interval value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_ObjectGetColl (OCI_Object *obj, const otext *attr)
 Return the collection value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_ObjectGetRef (OCI_Object *obj, const otext *attr)
 Return the Ref value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectGetObject (OCI_Object *obj, const otext *attr)
 Return the object value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_ObjectGetLob (OCI_Object *obj, const otext *attr)
 Return the lob value of the given object attribute.
 
OCI_SYM_PUBLIC OCI_File *OCI_API OCI_ObjectGetFile (OCI_Object *obj, const otext *attr)
 Return the file value of the given object attribute.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetBoolean (OCI_Object *obj, const otext *attr, boolean value)
 Set an object attribute of type boolean (ONLY for PL/SQL records)
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetNumber (OCI_Object *obj, const otext *attr, OCI_Number *value)
 Set an object attribute of type number.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetShort (OCI_Object *obj, const otext *attr, short value)
 Set an object attribute of type short.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedShort (OCI_Object *obj, const otext *attr, unsigned short value)
 Set an object attribute of type unsigned short.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetInt (OCI_Object *obj, const otext *attr, int value)
 Set an object attribute of type int.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedInt (OCI_Object *obj, const otext *attr, unsigned int value)
 Set an object attribute of type unsigned int.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetBigInt (OCI_Object *obj, const otext *attr, big_int value)
 Set an object attribute of type big int.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedBigInt (OCI_Object *obj, const otext *attr, big_uint value)
 Set an object attribute of type unsigned big int.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDouble (OCI_Object *obj, const otext *attr, double value)
 Set an object attribute of type double.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetFloat (OCI_Object *obj, const otext *attr, float value)
 Set an object attribute of type float.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetString (OCI_Object *obj, const otext *attr, const otext *value)
 Set an object attribute of type string.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetRaw (OCI_Object *obj, const otext *attr, void *value, unsigned int len)
 Set an object attribute of type RAW.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDate (OCI_Object *obj, const otext *attr, OCI_Date *value)
 Set an object attribute of type Date.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetTimestamp (OCI_Object *obj, const otext *attr, OCI_Timestamp *value)
 Set an object attribute of type Timestamp.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetInterval (OCI_Object *obj, const otext *attr, OCI_Interval *value)
 Set an object attribute of type Interval.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetColl (OCI_Object *obj, const otext *attr, OCI_Coll *value)
 Set an object attribute of type Collection.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetObject (OCI_Object *obj, const otext *attr, OCI_Object *value)
 Set an object attribute of type Object.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetLob (OCI_Object *obj, const otext *attr, OCI_Lob *value)
 Set an object attribute of type Lob.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetFile (OCI_Object *obj, const otext *attr, OCI_File *value)
 Set an object attribute of type File.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetRef (OCI_Object *obj, const otext *attr, OCI_Ref *value)
 Set an object attribute of type Ref.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectIsNull (OCI_Object *obj, const otext *attr)
 Check if an object attribute is null.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetNull (OCI_Object *obj, const otext *attr)
 Set an object attribute to null.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetStruct (OCI_Object *obj, void **pp_struct, void **pp_ind)
 Retrieve the underlying C (OTT/OCI style) structure of an OCI_Object handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectToText (OCI_Object *obj, unsigned int *size, otext *str)
 Convert an object handle value to a string.
 
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_RefCreate (OCI_Connection *con, OCI_TypeInfo *typinf)
 Create a local Ref instance.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefFree (OCI_Ref *ref)
 Free a local Ref.
 
OCI_SYM_PUBLIC OCI_Ref **OCI_API OCI_RefArrayCreate (OCI_Connection *con, OCI_TypeInfo *typinf, unsigned int nbelem)
 Create an array of Ref object.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefArrayFree (OCI_Ref **refs)
 Free an array of Ref objects.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefAssign (OCI_Ref *ref, OCI_Ref *ref_src)
 Assign a Ref to another one.
 
OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_RefGetTypeInfo (OCI_Ref *ref)
 Return the type info object associated to the Ref.
 
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_RefGetObject (OCI_Ref *ref)
 Returns the object pointed by the Ref handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefIsNull (OCI_Ref *ref)
 Check if the Ref points to an object or not.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefSetNull (OCI_Ref *ref)
 Nullify the given Ref handle.
 
OCI_SYM_PUBLIC unsigned int OCI_API OCI_RefGetHexSize (OCI_Ref *ref)
 Returns the size of the hex representation of the given Ref handle.
 
OCI_SYM_PUBLIC boolean OCI_API OCI_RefToText (OCI_Ref *ref, unsigned int size, otext *str)
 Converts a Ref handle value to a hexadecimal string.
 

Function Documentation

◆ OCI_ObjectCreate()

OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectCreate ( OCI_Connection con,
OCI_TypeInfo typinf 
)

#include <api.h>

Create a local object instance.

Parameters
con- Connection handle
typinf- Object type (type info handle)
Returns
Return the object handle on success otherwise NULL on failure

Referenced by ocilib::Object::Object().

◆ OCI_ObjectFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectFree ( OCI_Object obj)

#include <api.h>

Free a local object.

Parameters
obj- Object handle
Warning
Only object created with OCI_ObjectCreate() should be freed by OCI_ObjectFree()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectArrayCreate()

OCI_SYM_PUBLIC OCI_Object **OCI_API OCI_ObjectArrayCreate ( OCI_Connection con,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

#include <api.h>

Create an array of Object objects.

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 Object handle array on success otherwise NULL on failure

◆ OCI_ObjectArrayFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectArrayFree ( OCI_Object **  objs)

#include <api.h>

Free an array of Object objects.

Parameters
objs- Array of Object objects
Warning
Only arrays of Object created with OCI_ObjectArrayCreate() should be freed by OCI_ObjectArrayFree()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectAssign()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectAssign ( OCI_Object obj,
OCI_Object obj_src 
)

#include <api.h>

Assign an object to another one.

Parameters
obj- Destination Object handle
obj_src- Source Object handle
Note
Oracle proceeds to a deep copy of the object content
The two object handles must have the same type otherwise an exception is thrown
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Object::Clone().

◆ OCI_ObjectGetType()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetType ( OCI_Object obj)

#include <api.h>

Return the type of an object instance.

Parameters
obj- Object handle
Note
Possibles values are :
  • OCI_OBJ_PERSISTENT: persistent object from the DB
  • OCI_OBJ_TRANSIENT : local temporary object
  • OCI_OBJ_VALUE : embedded object
Returns
Instance type or OCI_UNKNOWN the input handle is NULL

Referenced by ocilib::Object::GetType().

◆ OCI_ObjectGetSelfRef()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetSelfRef ( OCI_Object obj,
OCI_Ref ref 
)

#include <api.h>

Retrieve an Oracle Ref handle from an object and assign it to the given OCILIB OCI_Ref handle.

Parameters
obj- Object handle
ref- Ref handle
Note
The type information of the object and the ref must be the same, otherwise an exception is thrown
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Object::GetReference().

◆ OCI_ObjectGetTypeInfo()

OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_ObjectGetTypeInfo ( OCI_Object obj)

#include <api.h>

Return the type info object associated to the object.

Parameters
obj- Object handle

Referenced by ocilib::Object::GetTypeInfo().

◆ OCI_ObjectGetBoolean()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetBoolean ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the boolean value of the given object attribute (ONLY for PL/SQL records)

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetBoolean() returns a valid value only for PL/SQL boolean based attributes
Warning
  • ONLY supported by Oracle 12c and above !
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetNumber()

OCI_SYM_PUBLIC OCI_Number *OCI_API OCI_ObjectGetNumber ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the number value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetNumber() returns a valid value only for number based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetShort()

OCI_SYM_PUBLIC short OCI_API OCI_ObjectGetShort ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the short value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetShort() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetUnsignedShort()

OCI_SYM_PUBLIC unsigned short OCI_API OCI_ObjectGetUnsignedShort ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the unsigned short value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetUnsignedShort() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetInt()

OCI_SYM_PUBLIC int OCI_API OCI_ObjectGetInt ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the integer value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetInt() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetUnsignedInt()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetUnsignedInt ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the unsigned integer value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetUnsignedInt() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetBigInt()

OCI_SYM_PUBLIC big_int OCI_API OCI_ObjectGetBigInt ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the big integer value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetBigInt() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetUnsignedBigInt()

OCI_SYM_PUBLIC big_uint OCI_API OCI_ObjectGetUnsignedBigInt ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the unsigned big integer value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetUnsignedBigInt() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetDouble()

OCI_SYM_PUBLIC double OCI_API OCI_ObjectGetDouble ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the double value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetDouble() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0.0 on failure or wrong attribute type

◆ OCI_ObjectGetFloat()

OCI_SYM_PUBLIC float OCI_API OCI_ObjectGetFloat ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the float value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetFloat() returns a valid value only for integer and number based attributes
Returns
Attribute value or 0.0 on failure or wrong attribute type

◆ OCI_ObjectGetString()

OCI_SYM_PUBLIC const otext *OCI_API OCI_ObjectGetString ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the string value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
The method can return a string value for any attributes types. It performs implicit string conversions using the same mechanisms than OCI_GetString(). See its documentation for more details.
Returns
Attribute value or NULL on failure

◆ OCI_ObjectGetRaw()

OCI_SYM_PUBLIC int OCI_API OCI_ObjectGetRaw ( OCI_Object obj,
const otext *  attr,
void *  value,
unsigned int  len 
)

#include <api.h>

Return the raw attribute value of the given object attribute into the given buffer.

Parameters
obj- Object handle
attr- Attribute name
value- Destination buffer
len- Max size to write into buffer
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetRaw() copies data into the buffer only for raw based attributes
Returns
Number of bytes written to the buffer or 0 on failure or wrong attribute type

◆ OCI_ObjectGetRawSize()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_ObjectGetRawSize ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the raw attribute value size of the given object attribute into the given buffer.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity.
Returns
size in bytes of the RAW value or 0 on failure or wrong attribute type

◆ OCI_ObjectGetDate()

OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_ObjectGetDate ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the date value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetDate() returns a valid value only for date based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetTimestamp()

OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_ObjectGetTimestamp ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the timestamp value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetTimestamp() returns a valid value only for timestamps based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetInterval()

OCI_SYM_PUBLIC OCI_Interval *OCI_API OCI_ObjectGetInterval ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the interval value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetInterval() returns a valid value only for intervals based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetColl()

OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_ObjectGetColl ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the collection value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetColl() returns a valid value only for intervals based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

Referenced by ocilib::Object::Get().

◆ OCI_ObjectGetRef()

OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_ObjectGetRef ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the Ref value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetRef() returns a valid value only for Refs based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetObject()

OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ObjectGetObject ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the object value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetObject() returns a valid value only for object based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetLob()

OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_ObjectGetLob ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the lob value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetLob() returns a valid value only for lobs based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectGetFile()

OCI_SYM_PUBLIC OCI_File *OCI_API OCI_ObjectGetFile ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Return the file value of the given object attribute.

Parameters
obj- Object handle
attr- Attribute name
Note
If the attribute is found in the object descriptor attributes list, then a data type check is performed for integrity. OCI_ObjectGetFile() returns a valid value only for files based attributes
Returns
Attribute value or NULL on failure or wrong attribute type

◆ OCI_ObjectSetBoolean()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetBoolean ( OCI_Object obj,
const otext *  attr,
boolean  value 
)

#include <api.h>

Set an object attribute of type boolean (ONLY for PL/SQL records)

Parameters
obj- Object handle
attr- Attribute name
value- boolean value
Warning
  • ONLY supported by Oracle 12c and above !
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetNumber()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetNumber ( OCI_Object obj,
const otext *  attr,
OCI_Number value 
)

#include <api.h>

Set an object attribute of type number.

Parameters
obj- Object handle
attr- Attribute name
value- number value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetShort()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetShort ( OCI_Object obj,
const otext *  attr,
short  value 
)

#include <api.h>

Set an object attribute of type short.

Parameters
obj- Object handle
attr- Attribute name
value- Short value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetUnsignedShort()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedShort ( OCI_Object obj,
const otext *  attr,
unsigned short  value 
)

#include <api.h>

Set an object attribute of type unsigned short.

Parameters
obj- Object handle
attr- Attribute name
value- Unsigned short value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetInt ( OCI_Object obj,
const otext *  attr,
int  value 
)

#include <api.h>

Set an object attribute of type int.

Parameters
obj- Object handle
attr- Attribute name
value- Int value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetUnsignedInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedInt ( OCI_Object obj,
const otext *  attr,
unsigned int  value 
)

#include <api.h>

Set an object attribute of type unsigned int.

Parameters
obj- Object handle
attr- Attribute name
value- Unsigned int value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetBigInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetBigInt ( OCI_Object obj,
const otext *  attr,
big_int  value 
)

#include <api.h>

Set an object attribute of type big int.

Parameters
obj- Object handle
attr- Attribute name
value- Big int value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetUnsignedBigInt()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetUnsignedBigInt ( OCI_Object obj,
const otext *  attr,
big_uint  value 
)

#include <api.h>

Set an object attribute of type unsigned big int.

Parameters
obj- Object handle
attr- Attribute name
value- Unsigned big int value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetDouble()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDouble ( OCI_Object obj,
const otext *  attr,
double  value 
)

#include <api.h>

Set an object attribute of type double.

Parameters
obj- Object handle
attr- Attribute name
value- Double value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetFloat()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetFloat ( OCI_Object obj,
const otext *  attr,
float  value 
)

#include <api.h>

Set an object attribute of type float.

Parameters
obj- Object handle
attr- Attribute name
value- Float value
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetString()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetString ( OCI_Object obj,
const otext *  attr,
const otext *  value 
)

#include <api.h>

Set an object attribute of type string.

Parameters
obj- Object handle
attr- Attribute name
value- String value
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetRaw()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetRaw ( OCI_Object obj,
const otext *  attr,
void *  value,
unsigned int  len 
)

#include <api.h>

Set an object attribute of type RAW.

Parameters
obj- Object handle
attr- Attribute name
value- Raw value
len- Size of the raw value
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetDate()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetDate ( OCI_Object obj,
const otext *  attr,
OCI_Date value 
)

#include <api.h>

Set an object attribute of type Date.

Parameters
obj- Object handle
attr- Attribute name
value- Date Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetTimestamp()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetTimestamp ( OCI_Object obj,
const otext *  attr,
OCI_Timestamp value 
)

#include <api.h>

Set an object attribute of type Timestamp.

Parameters
obj- Object handle
attr- Attribute name
value- Timestamp Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetInterval()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetInterval ( OCI_Object obj,
const otext *  attr,
OCI_Interval value 
)

#include <api.h>

Set an object attribute of type Interval.

Parameters
obj- Object handle
attr- Attribute name
value- Interval Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetColl()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetColl ( OCI_Object obj,
const otext *  attr,
OCI_Coll value 
)

#include <api.h>

Set an object attribute of type Collection.

Parameters
obj- Object handle
attr- Attribute name
value- Collection Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Object::Set().

◆ OCI_ObjectSetObject()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetObject ( OCI_Object obj,
const otext *  attr,
OCI_Object value 
)

#include <api.h>

Set an object attribute of type Object.

Parameters
obj- Object handle
attr- Attribute name
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_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetLob()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetLob ( OCI_Object obj,
const otext *  attr,
OCI_Lob value 
)

#include <api.h>

Set an object attribute of type Lob.

Parameters
obj- Object handle
attr- Attribute name
value- Lob Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetFile()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetFile ( OCI_Object obj,
const otext *  attr,
OCI_File value 
)

#include <api.h>

Set an object attribute of type File.

Parameters
obj- Object handle
attr- Attribute name
value- File Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectSetRef()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetRef ( OCI_Object obj,
const otext *  attr,
OCI_Ref value 
)

#include <api.h>

Set an object attribute of type Ref.

Parameters
obj- Object handle
attr- Attribute name
value- Ref Handle
Note
passing a null pointer for value calls OCI_ObjectSetNull()
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectIsNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectIsNull ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Check if an object attribute is null.

Parameters
obj- Object handle
attr- Attribute name
Returns
FALSE if the attribute is not null otherwise TRUE

Referenced by ocilib::Object::IsAttributeNull().

◆ OCI_ObjectSetNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectSetNull ( OCI_Object obj,
const otext *  attr 
)

#include <api.h>

Set an object attribute to null.

Parameters
obj- Object handle
attr- Attribute name
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Object::SetAttributeNull().

◆ OCI_ObjectGetStruct()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectGetStruct ( OCI_Object obj,
void **  pp_struct,
void **  pp_ind 
)

#include <api.h>

Retrieve the underlying C (OTT/OCI style) structure of an OCI_Object handle.

Parameters
obj- Object handle
pp_struct- Address of a pointer that retrieve the C structure of data
pp_ind- Address of a pointer that retrieve the C structure of indicators
Note
See Oracle OCI programming guide for more details about OTT structures. The members of these structures are OCI data types like OCINumber, OCIString that requires mixing OCILIB code and raw OCI code. OCI Object API headers have to be included to handle this data types using OCI object functions
Returns
TRUE on success otherwise FALSE

◆ OCI_ObjectToText()

OCI_SYM_PUBLIC boolean OCI_API OCI_ObjectToText ( OCI_Object obj,
unsigned int *  size,
otext *  str 
)

#include <api.h>

Convert an object handle value to a string.

Parameters
obj- Object handle
size- Destination string length pointer in characters
str- Destination string
Note
In order to compute the needed string length, call the method with a NULL string Then call the method again with a valid buffer
The resulting string is similar to the SQL*PLUS output for UDTs (user types and objects) For RAWs and BLOBs attributes, their binary values are converted to hexadecimal strings
Warning
This convenient method shall not be used when performance matters. It is usually called twice (buffer length computation) and must also care about quotes within strings.
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Object::ToString().

◆ OCI_RefCreate()

OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_RefCreate ( OCI_Connection con,
OCI_TypeInfo typinf 
)

#include <api.h>

Create a local Ref instance.

Parameters
con- Connection handle
typinf- Ref type
Returns
Return the Ref handle on success otherwise NULL on failure

Referenced by ocilib::Object::GetReference(), and ocilib::Reference::Reference().

◆ OCI_RefFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefFree ( OCI_Ref ref)

#include <api.h>

Free a local Ref.

Parameters
ref- Ref handle
Warning
Only Refs created with OCI_RefCreate() should be freed by OCI_RefFree()
Returns
TRUE on success otherwise FALSE

◆ OCI_RefArrayCreate()

OCI_SYM_PUBLIC OCI_Ref **OCI_API OCI_RefArrayCreate ( OCI_Connection con,
OCI_TypeInfo typinf,
unsigned int  nbelem 
)

#include <api.h>

Create an array of Ref object.

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

◆ OCI_RefArrayFree()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefArrayFree ( OCI_Ref **  refs)

#include <api.h>

Free an array of Ref objects.

Parameters
refs- Array of Ref objects
Warning
Only arrays of Ref created with OCI_RefArrayCreate() should be freed by OCI_RefArrayFree()
Returns
TRUE on success otherwise FALSE

◆ OCI_RefAssign()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefAssign ( OCI_Ref ref,
OCI_Ref ref_src 
)

#include <api.h>

Assign a Ref to another one.

Parameters
ref- Destination Ref handle
ref_src- Source Ref handle
Note
The two Ref handles must have the same type otherwise an exception is thrown
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Reference::Clone().

◆ OCI_RefGetTypeInfo()

OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_RefGetTypeInfo ( OCI_Ref ref)

#include <api.h>

Return the type info object associated to the Ref.

Parameters
ref- Ref handle

Referenced by ocilib::Reference::GetTypeInfo().

◆ OCI_RefGetObject()

OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_RefGetObject ( OCI_Ref ref)

#include <api.h>

Returns the object pointed by the Ref handle.

Parameters
ref- Ref handle
Returns
The object handle is the ref is not null otherwise NULL

Referenced by ocilib::Reference::GetObject().

◆ OCI_RefIsNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefIsNull ( OCI_Ref ref)

#include <api.h>

Check if the Ref points to an object or not.

Parameters
ref- Ref handle
Returns
TRUE if it does not point to a valid object otherwise FALSE

Referenced by ocilib::Reference::IsReferenceNull().

◆ OCI_RefSetNull()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefSetNull ( OCI_Ref ref)

#include <api.h>

Nullify the given Ref handle.

Parameters
ref- Ref handle
Note
this call clears the reference to object pointed by the Ref handle.
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Reference::SetReferenceNull().

◆ OCI_RefGetHexSize()

OCI_SYM_PUBLIC unsigned int OCI_API OCI_RefGetHexSize ( OCI_Ref ref)

#include <api.h>

Returns the size of the hex representation of the given Ref handle.

Parameters
ref- Ref handle
Note
the returned size is the number of character needed to store the hex representation of the Ref that can be retrieved with OCI_RefToText()

Referenced by ocilib::Reference::ToString().

◆ OCI_RefToText()

OCI_SYM_PUBLIC boolean OCI_API OCI_RefToText ( OCI_Ref ref,
unsigned int  size,
otext *  str 
)

#include <api.h>

Converts a Ref handle value to a hexadecimal string.

Parameters
ref- Ref handle
size- Destination string size in characters
str- Destination string
Returns
TRUE on success otherwise FALSE

Referenced by ocilib::Reference::ToString().