Oracle® Call Interface Programmer's Guide, 10g Release 2 (10.2) Part Number B14250-02 |
|
|
PDF · Mobi · ePub |
This section describes the Any Data Set Interface functions.
Table 20-7 Any Data Set Functions
Function/Page | Purpose |
---|---|
Adds a new skeleton instance to the |
|
Allocates an |
|
Frees the |
|
Marks the end of |
|
Gets the number of instances in the |
|
Returns the |
|
Gets the type corresponding to an |
Adds a new skeleton instance to the OCIAnyDataSet
and all the attributes of the instance are set to NULL
.
sword OCIAnyDataSetAddInstance ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCIAnyData **data );
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()
.
OCIAnyDataSet
to which a new instance is added.
OCIAnyData
corresponding to the newly added instance. If (*data)
is NULL
, a new OCIAnyData
will be allocated for the same duration as the OCIAnyDataSet
. If (*data)
is not NULL
, it will be reused. This OCIAnyData
can be subsequently constructed using the OCIAnyDataConvert()
call or it can be constructed piece-wise using the OCIAnyDataAttrSet()
or the OCIAnyDataCollAddElem()
calls.
This call returns this skeleton instance through the OCIAnyData
parameter which can be constructed subsequently by invoking the OCIAnyData API.
Note:
No destruction of the old value is done here. It is your responsibility to destroy the old value pointed to by (*data
) and set (*data
) to a NULL
pointer before beginning to make a sequence of these calls. No deep copying (of OCIType
information or of the data part) is done in the returned OCIAnyData
. This OCIAnyData
cannot be used beyond the allocation duration of the OCIAnyDataSet
(it is like a reference into the OCIAnyDataSet
). The returned OCIAnyData
can be reused on subsequent calls to this function, to sequentially add new data instances to the OCIAnyDataSet
.Allocates an OCIAnyDataSet
for the given duration and initializes it with the type information. The OCIAnyDataSet
can hold multiple instances of the given type.
sword OCIAnyDataSetBeginCreate ( OCISvcCtx *svchp, OCIError *errhp, OCITypeCode typecode, CONST OCIType *type, OCIDuration dur, OCIAnyDataSet **data_set );
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()
.
Typecode corresponding to the OCIAnyDataSet
.
Type corresponding to the OCIAnyDataSet
. If the typecode corresponds to a built-in type (OCI_TYPECODE_NUMBER
, and so on), this parameter can be NULL
. It should be non-NULL
for user defined types (OCI_TYPECODE_OBJECT
, OCI_TYPECODE_REF
, collection types, and so on).
Duration for which OCIAnyDataSet
is allocated. One of the following:
Initialized OCIAnyDataSet
.
For performance reasons, the OCIAnyDataSet
will end up pointing to the OCIType
parameter passed in. It is your responsibility to ensure that the OCIType
is longer lived (has allocation duration >= the duration of the OCIAnyData
if the OCIType
is a transient one, or has allocation/pin duration >= duration of the OCIAnyData,
if the OCIType
is a persistent one).
Frees the OCIAnyDataSet
.
sword OCIAnyDataSetDestroy ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set );
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()
.
OCIAnyDataSet
to be freed.
Marks the end of OCIAnyDataSet
creation. It should be called after constructing all of its instances.
sword OCIAnyDataSetEndCreate ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set );
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 OCIAnyDataSet
.
Gets the number of instances in the OCIAnyDataSet
.
sword OCIAnyDataSetGetCount( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, ub4 *count );
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()
.
A well-formed OCIAnyDataSet
.
Number of instances in OCIAnyDataSet
.
Returns the OCIAnyData
corresponding to an instance at the current position and updates the current position.
sword OCIAnyDataSetGetInstance ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCIAnyData **data );
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()
.
A well-formed OCIAnyDataSet
.
OCIAnyDat
a corresponding to the instance. If (*data) is NULL
, a new OCIAnyData
will be allocated for same duration as the OCIAnyDataSet
. If (*data
) is not NULL
, it will be reused.
Only sequential access to the instances in an OCIAnyDataSet
is allowed. This call returns the OCIAnyData
corresponding to an instance at the current position and updates the current position. Subsequently, the OCIAnyData access routines may be used to access the instance.
Gets the type corresponding to an OCIAnyDataSet
.
sword OCIAnyDataSetGetType ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type );
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 OCIAnyDataSet
.
The typecode corresponding to the type of the OCIAnyDataSet
.
The type corresponding to the OCIAnyDataSet
. This will be NULL
if the OCIAnyData
corresponds to a built-in type.