Oracle Call Interface Programmer's Guide Release 2 (9.2) Part Number A96584-01 |
|
OCI Any Type and Data Functions, 9 of 26
Sets the attribute at the current position with a given value.
sword OCIAnyDataAttrSet ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata, OCITypeCode tc, OCIType *attr_type, dvoid *null_ind, dvoid *attr_value, ub4 length, boolean is_any );
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.
Typecode of the attribute. Type checking happens based on tc
, attr_type
and the type information in the OCIAnyData.
OPTIONAL
attr_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_VARRAY, OCI_TYPECODE_TABLE) and it will give the type description of the object (for OCI_TYPECODE_OBJECT). This parameter is not required for built-in typecodes or if OCI_TYPECODE_NONE is specified.
Indicates if the attr_value
is NULL. Pass (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 attr_value
as the argument here.
Value for the attribute
Currently, this parameter is ignored. Pass 0 here. In the future, this may be used for certain typecodes where the data representation itself will not give the length implicitly.
Is attribute in the form of OCIAnyData?
OCIAnyDataBeginCreate()
creates an OCIAnyData with an empty skeleton instance. To fill the attribute values, use OCIAnyDataAttrSet()
(for OCI_TYPECODE_OBJECT) or OCIAnyDataCollAttrAddElem()
(for the collection typecodes).
Attribute values must be set in order, from the first attribute to the last. The current attribute number is remembered as state maintained inside the OCIAnyData. Piece-wise construction of embedded attributes and collection elements are not yet supported.
This call sets the attribute at the current position with attr_value
. Once piece-wise construction has started for an OCIAnyData instance, the OCIAnyDataConstruct()
calls can no longer be used.
tc
must match the type of the attribute at the current position. Otherwise, an error is returned.
If is_any
is TRUE, then the attribute must be in the form of OCIAnyData*
and it is copied into the enclosing OCIAnyData (data) without any conversion.
Here is the list of available datatypes which can be used as object attribute types and the corresponding types of the attribute value that should be passed:
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|