Skip Headers
Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E17727-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

Delete (OraCollection) Method

Applies To

OraCollection Object

Description

Deletes an element at given index. This method is available only in an OraCollection of type ORATYPE_TABLE (nested table).

Usage

OraCollection.Delete index

Arguments

The arguments for the method are:

Arguments Description
[in] index An Integer specifying the index of the element to be deleted.

Remarks

The Delete method creates holes in the client-side nested table. This method returns an error if the element at the given index has already been deleted or if the given index is not valid for the given table.

Examples

The following example illustrates the Delete method. Before running the sample code, make sure that you have the necessary data types and tables in the database. See "Schema Objects Used in OraCollection Examples" .

Dim OraSession as OraSession
Dim OraDatabase as OraDatabase
Dim OraDynaset as OraDynaset
Dim CourseList as OraCollection
 
'create the OraSession Object.
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
 
'create the OraDatabase Object by opening a connection to Oracle.
Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/tiger", 0&)
 
'create a dynaset object from division
set OraDynaset = OraDatabase.CreateDynaset("select * from division", 0&)
 
'retrieve a Courses column from Division. 
'Here Value property of OraField object returns CourseList OraCollection
set CourseList = OraDynaset.Fields("Courses").Value
 
'Delete the CourseList  NestedTable at index 2. 
'Before that lock should be obtained
OraDynaset.Edit
CourseList.Delete 2
 
OraDynaset.Update