Oracle Objects for OLE
Release 8.1.7

Part Number A85257-01

Library

Product

Contents

Accessing Collection Elements

Individual element values are accessed by using a subscript. For example, the Value returned by OraCollection for subscript 1 is the element value at index 1. The maximum value of the subscript is equal to total number of elements in the collection including deleted elements. The OraCollection subscript starts from 1.

The following example code retrieves the ENAMELIST collection instance and accesses its elements at the first and second index.

set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

set hrDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)

Set Dept = hrDb.CreateDynaset("select * from department", 0&)

Set EnameList = Dept.Fields("ENAMES").Value

msgbox EnameList(1)

msgbox EnameList(2)

This code displays all the element values of EnameList

For I = 1 to EnameList.Size

msgbox EnameList(I)

Next I


 
Oracle
Copyright copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents