Skip Headers

Oracle9i Supplied PL/SQL Packages and Types Reference
Release 2 (9.2)

Part Number A96612-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

103
ANYDATA TYPE

An ANYDATA contains an instance of a given type, plus a description of the type. In this sense, an ANYDATA is self-describing. An ANYDATA can be persistently stored in the database.

Persistent storage of ANYDATA instances whose type contains embedded LOBs is not supported yet.

This chapter discusses the following topics:

Construction

There are 2 ways to construct an AnyData. The Convert*() calls enable construction of the AnyData in its entirety with a single call. They serve as explicit CAST functions from any type in the Oracle ORDBMS to AnyData.

  STATIC FUNCTION ConvertNumber(num IN NUMBER) RETURN AnyData,
  STATIC FUNCTION ConvertDate(dat IN DATE) RETURN AnyData,
  STATIC FUNCTION ConvertChar(c IN CHAR) RETURN AnyData,
  STATIC FUNCTION ConvertVarchar(c IN VARCHAR) RETURN AnyData,
  STATIC FUNCTION ConvertVarchar2(c IN VARCHAR2) RETURN AnyData,
  STATIC FUNCTION ConvertRaw(r IN RAW) RETURN AnyData,
  STATIC FUNCTION ConvertBlob(b IN BLOB) RETURN AnyData,
  STATIC FUNCTION ConvertClob(c IN CLOB) RETURN AnyData,
  STATIC FUNCTION ConvertBfile(b IN BFILE) RETURN AnyData,
  STATIC FUNCTION ConvertObject(obj IN "<object_type>") RETURN AnyData,
  STATIC FUNCTION ConvertRef(rf IN REF "<object_type>") RETURN AnyData,
  STATIC FUNCTION ConvertCollection(col IN "<COLLECTION_1>") RETURN AnyData,

The second way to construct an AnyData is a piece by piece approach. The BeginCreate() call begins the construction process and EndCreate() call finishes the construction process. In between these two calls, the individual attributes of an object type or the elements of a collection can be set using Set*() calls. For piece by piece access of the attributes of objects and elements of collections, the PieceWise() call should be invoked prior to Get*() calls.

Note: The AnyData has to be constructed or accessed sequentially starting from its first attribute (or collection element). The BeginCreate() call automatically begins the construction in a piece-wise mode. There is no need to call PieceWise() immediately after BeginCreate(). EndCreate() should be called to finish the construction process (before which any access calls can be made).


Go to previous page Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback