Oracle® Call Interface Programmer's Guide, 11g Release 2 (11.2) Part Number E10646-02 |
|
|
View PDF |
This section describes the Any Data Set Interface functions.
Table 21-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 |
Purpose
Adds a new skeleton instance to the OCIAnyDataSet
and all the attributes of the instance are set to NULL
.
Syntax
sword OCIAnyDataSetAddInstance ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCIAnyData **data );
Parameters
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.
Comments
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
.Purpose
Allocates an OCIAnyDataSet
for the given duration and initializes it with the type information. The OCIAnyDataSet
can hold multiple instances of the given type.
Syntax
sword OCIAnyDataSetBeginCreate ( OCISvcCtx *svchp, OCIError *errhp, OCITypeCode typecode, const OCIType *type, OCIDuration dur, OCIAnyDataSet **data_set );
Parameters
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
.
Comments
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).
Purpose
Frees the OCIAnyDataSet
.
Syntax
sword OCIAnyDataSetDestroy ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set );
Parameters
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.
Purpose
Marks the end of OCIAnyDataSet
creation. It should be called after constructing all of its instances.
Syntax
sword OCIAnyDataSetEndCreate ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set );
Parameters
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
.
Purpose
Gets the number of instances in the OCIAnyDataSet
.
Syntax
sword OCIAnyDataSetGetCount( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, ub4 *count );
Parameters
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
.
Purpose
Returns the OCIAnyData
corresponding to an instance at the current position and updates the current position.
Syntax
sword OCIAnyDataSetGetInstance ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCIAnyData **data );
Parameters
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.
Comments
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.
Purpose
Gets the type corresponding to an OCIAnyDataSet
.
Syntax
sword OCIAnyDataSetGetType ( OCISvcCtx *svchp, OCIError *errhp, OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type );
Parameters
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.