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

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 © 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