Oracle9i Supplied PL/SQL Packages and Types Reference Release 2 (9.2) Part Number A96612-01 |
|
ANYDATA TYPE, 2 of 2
This procedure begins the creation process on a new AnyData.
STATIC PROCEDURE BeginCreate( dtype IN OUT NOCOPY AnyType, adata OUT NOCOPY AnyData);
Parameter | Description |
---|---|
|
The type of the AnyData. (Should correspond to |
|
AnyData being constructed. |
DBMS_TYPES.invalid_parameters: dtype is invalid (not fully constructed, etc.)
There is no need to call PieceWise()
immediately after this call. The construction process begins in a piece-wise manner automatically.
This procedure sets the MODE of access of the current data value to be an attribute at a time (if the data value is of TYPECODE_OBJECT
).
It sets the MODE of access of the data value to be a collection element at a time (if the data value is of collection type). Once this call has been made, subsequent calls to Set*()
and Get*()
will sequentially obtain individual attributes or collection elements.
MEMBER PROCEDURE PieceWise( self IN OUT NOCOPY AnyData);
Parameter | Description |
---|---|
|
The current data value. |
The current data value must be of an OBJECT or COLLECTION type before this call can be made.
Piece-wise construction and access of nested attributes that are of object or collection types is not supported.
Sets the current data value.
This is a list of procedures that should be called depending on the type of the current data value. The type of the data value should be the type of the attribute at the current position during the piece-wise construction process.
MEMBER PROCEDURE SetNumber( self IN OUT NOCOPY AnyData, num IN NUMBER, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetDate( self IN OUT NOCOPY AnyData, dat IN DATE, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetChar( self IN OUT NOCOPY AnyData, c IN CHAR, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetVarchar( self IN OUT NOCOPY AnyData, c IN VARCHAR, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetVarchar2( self IN OUT NOCOPY AnyData, c IN VARCHAR2, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetRaw( self IN OUT NOCOPY AnyData, r IN RAW, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetBlob( self IN OUT NOCOPY AnyData, b IN BLOB, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetClob( self IN OUT NOCOPY AnyData, c IN CLOB, last_elem IN boolean DEFAULT FALSE)' MEMBER PROCEDURE SetBfile( self IN OUT NOCOPY AnyData, b IN BFILE, last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetObject( self IN OUT NOCOPY AnyData, obj IN "<object_type>", last_elem IN boolean DEFAULT FALSE); MEMBER PROCEDURE SetRef( self IN OUT NOCOPY AnyData, rf IN REF "<object_type>", last_elem IN boolean DEFAULT FALSE), MEMBER PROCEDURE SetCollection( self IN OUT NOCOPY AnyData, col IN "<collectyion_type>", last_elem IN boolean DEFAULT FALSE);
When BeginCreate()
is called, construction has already begun in a piece-wise fashion. Subsequent calls to Set*()
will set the successive attribute values.
If the AnyData is a standalone collection, the Set*()
call will set the successive collection elements.
This procedure ends creation of an AnyData. Other creation functions cannot be called after this call.
MEMBER PROCEDURE EndCreate( self IN OUT NOCOPY AnyData);
Parameter | Description |
---|---|
|
An AnyData. |
This function gets the fully qualified type name for the AnyData.
If the AnyData is based on a built-in type, this function will return NUMBER etc.
If it is based on a user defined type, this function will return <schema_name>.<type_name>. for example, SCOTT.FOO.
If it is based on a transient anonymous type, this function will return NULL.
MEMBER FUNCTION GetTypeName( self IN AnyData) RETURN VARCHAR2;
Parameter | Description |
---|---|
|
An AnyData. |
Type name of the AnyData.
This function gets the typecode of the AnyData.
MEMBER FUNCTION GetType( self IN AnyData, typ OUT NOCOPY AnyType) RETURN PLS_INTEGER;
Parameter | Description |
---|---|
|
An AnyData. |
|
The AnyType corresponding to the AnyData. May be NULL if it does not represent a user-defined type. |
The typecode corresponding to the type of the AnyData.
These functions get the current data value (which should be of appropriate type).
The type of the current data value depends on the MODE with which we are accessing (depending on whether we have invoked the PieceWise()
call).
If PieceWise()
has NOT been called, we are accessing the AnyData in its entirety and the type of the data value should match the type of the AnyData.
If PieceWise()
has been called, we are accessing the AnyData piece-wise. The type of the data value should match the type of the attribute (or collection element) at the current position.
MEMBER FUNCTION GetNumber( self IN AnyData, num OUT NOCOPY NUMBER) RETURN PLS_INTEGER; MEMBER FUNCTION GetDate( self IN AnyData, dat OUT NOCOPY DATE) RETURN PLS_INTEGER; MEMBER FUNCTION GetChar( self IN AnyData, c OUT NOCOPY CHAR) RETURN PLS_INTEGER; MEMBER FUNCTION GetVarchar( self IN AnyData, c OUT NOCOPY VARCHAR) RETURN PLS_INTEGER; MEMBER FUNCTION GetVarchar2( self IN AnyData, c OUT NOCOPY VARCHAR2) RETURN PLS_INTEGER; MEMBER FUNCTION GetRaw( self IN AnyData, r OUT NOCOPY RAW) RETURN PLS_INTEGER; MEMBER FUNCTION GetBlob( self IN AnyData, b OUT NOCOPY BLOB) RETURN PLS_INTEGER; MEMBER FUNCTION GetClob( self IN AnyData, c OUT NOCOPY CLOB) RETURN PLS_INTEGER; MEMBER FUNCTION GetBfile( self IN AnyData, b OUT NOCOPY BFILE) RETURN PLS_INTEGER; MEMBER FUNCTION GetObject( self IN AnyData, obj OUT NOCOPY "<object_type>") RETURN PLS_INTEGER; MEMBER FUNCTION GetRef( self IN AnyData, rf OUT NOCOPY REF "<object_type>") RETURN PLS_INTEGER; MEMBER FUNCTION GetCollection( self IN AnyData, col OUT NOCOPY "<collection_type>") RETURN PLS_INTEGER;
Parameter | Description |
---|---|
|
An AnyData. |
|
The number, etc., to be obtained. |
DBMS_TYPES.SUCCESS or DBMS_TYPES.NO_DATA
The return value is relevant only if PieceWise()
has been already called (for a collection). In such a case, DBMS_TYPES.NO_DATA signifies the end of the collection when all elements have been accessed.
DBMS_TYPES.type_mismatch: When the expected type is different from the passed in type.
DBMS_TYPES.invalid_parameters: Invalid Parameters (if it is not appropriate to add a number at this point in the creation process).
DBMS_TYPES.incorrect_usage: Incorrect usage.
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|