|Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows
Part Number E17727-03
|PDF · Mobi · ePub|
Deletes an element at given index. This method is available only in an
OraCollection of type
ORATYPE_TABLE (nested table).
The arguments for the method are:
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.
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
See Also:Type (OraCollection) Property