Oracle Call Interface Programmer's Guide Release 2 (9.2) Part Number A96584-01 |
|
OCI Any Type and Data Functions, 11 of 26
Adds the next collection element to the collection attribute of the OCIAnyData at the current attribute position. If the OCIAnyData is of a collection type, then there is no notion of attribute position and this call adds the next collection element.
sword OCIAnyDataCollAddElem ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata, OCITypeCode collelem_tc, OCIType *collelem_type, dvoid *null_ind, dvoid *elem_value, ub4 length, boolean is_any, boolean last_elem );
The OCI service context.
The OCI error handle. If there is an error, it is recorded in err
and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet()
.
Initialized OCIAnyData.
The typecode of the collection element to be added. Type checking happens based on collelem_tc
, collelem_type
and the type information in the OCIAnyData.
OPTIONAL
collelem_type
will give the type description of the referenced type (for OCI_TYPECODE_REF) and it will give the type description of the collection type (for OCI_TYPECODE_NAMEDCOLLECTION) and it will give the type description of the object (for OCI_TYPECODE_OBJECT).
This parameter is not required for built-in typecodes.
Indicates if the elem_value
is NULL. Pass an (OCIInd *)
for all typecodes except OCI_TYPECODE_OBJECT. The indicator should be OCI_IND_NOTNULL if the value is not NULL and it should be OCI_IND_NULL for a NULL value.
If the typecode is OCI_TYPECODE_OBJECT, pass a pointer to the indicator struct of the elem_value
as the argument here.
Value for the collection element
Length of the collection element
Is the attribute in the form of OCIAnyData?
Is the element being added the last in the collection?
This call can be invoked for an OCIAnyData of type OCI_TYPECODE_OBJECT or of any of the collection types. Once piece-wise construction has started for an OCIAnyData instance, the OCIAnyDataConstruct()
calls can no longer be used.
As in OCIAnyDataAttrSet()
, is_any
is applicable only if the collelem_tc
is that of typecode OCI_TYPECODE_OBJECT or a collection typecode. If is_any
is TRUE
, the attribute should be in the form of OCIAnyData *
.
If the element being added is the last element in the collection, last_elem
should be set to TRUE
.
To add a NULL element, the NULL indicator, null_ind
should be set to OCI_IND_NULL, in which case all other arguments will be ignored. Otherwise, null_ind
must be set to OCI_IND_NOTNULL.
See OCIAnyDataAttrSet()
for the type of attribute to be passed in for all the possible types of the collection elements.
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|