Oracle Objects for OLE
Release 9.2

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

Master Index

Feedback

OraCollection Object

See Also
Properties
Methods
Examples

Description

The OraCollection interface represents Oracle collection types, such as variable-length arrays (VARRAYs) and Nested Tables.

Remarks

A Collection is an ordered group of elements, all of the same type. For example, the students in a class or the grades for each student in a class. Each element has a unique subscript, called an index, that determines its position in the collection.

The Collection type Nested Table is viewed as a table stored in the column of database tables. When retrieved, rows of a Nested Table are given consecutive subscripts starting at 1. Individual rows are accessed using an array-like access.

The Collection type VARRAY is viewed as array stored in the column of database tables. To reference an element in a VARRAY, standard subscripting syntax can be used. For example, Grade(3) references the third element in VARRAY named Grades.

The OraCollection provides methods for accessing and manipulating an Oracle collection. Implicitly an OraCollection contains a OLE automation collection interface for accessing and manipulating (updating and inserting) individual elements of an Oracle collection. Individual elements can be accessed by using a subscript. An OraCollection element index starts at 1.

Element values are retrieved as Variant types. The Variant type of the element depends on the element type of the collection . Element values can be Null and can be set to Null. For elements of type objects and REFs, element values are returned as corresponding OO4O objects for that type. VARRAYs and Nested tables do not support the elements of LOBs, VARRAYs, and Nested tables. The following table shows the element type and return value of the elements.

Element Type and Return Value of Elements

Element Type
Element Value
Object
OraObject
REF
OraRef
Date
String
Number
String
CHAR,VARCHAR2
String
Real
Real
Integer
Integer

Element values are converted into a Variant SAFEARRAY format using the SafeArray Property. Elements of primitive types are only supported. A Variant SAFEARRAY index starts at 0.

The CreateOraObject method on the OraDatabase object returns the OraCollection. The Oracle collection associated with this OraCollection is created in the client side object cache.

For information on initializing an OraCollection representing an Oracle collection in OO4O, see Initializing Oracle LOBs, Objects, and Collection. For information on creating a dynaset from a collection, refer to Creating a Dynaset from an OraCollection.


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

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

Master Index

Feedback