'Declaration Public Class OracleArray Implements ICustomOracleArray, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IListSource, System.Data.SqlTypes.INullable, System.ICloneable |
'Declaration Public Class OracleArray Implements ICustomOracleArray, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IListSource, System.Data.SqlTypes.INullable, System.ICloneable |
The OracleArray class provides methods to access elements of the collection. Items values are accessible by Item indexed property.
The array elements can be added to the collection dynamically by calling Add, Insert methods or removed by calling Remove or RemoveAt but the maximum number of the elements cannot exceed Capacity specified at Oracle declaration of the VARRAY.
Indexes in this collection are zero-based.
Note that OracleArray can be used in data binding with DataGrid as it implements IListSource interface.
This example demonstrates how to retrieve OracleArray object from server and display its elements. To create required type and table and fill it with data you can use the following script:
CREATE OR REPLACE TYPE TEmployees AS
VARYING ARRAY(10000) OF VARCHAR2(40);
CREATE TABLE CompanyEmpObject (
Code NUMBER PRIMARY KEY,
Company VARCHAR2(40),
Employees TEmployees
);
INSERT INTO CompanyEmpObject
(Code, Company, Employees)
VALUES
(1, 'Microsoft', TEmployees('PROGRAMMER', 'MANAGER', 'ELECTRICIAN', 'CLEANUP MEN'));
INSERT INTO CompanyEmpObject
(Code, Company, Employees)
VALUES
(2, 'Borland', TEmployees('PROGRAMMER', 'ELECTRICIAN', 'COURIER'));
INSERT INTO CompanyEmpObject
(Code, Company, Employees)
VALUES
(3, 'MC Donalds', TEmployees('SHOP ASSISTANT', 'CLERK', 'CLEANUP MEN'));
INSERT INTO CompanyEmpObject
(Code, Company, Employees)
VALUES
(4, 'Ford', TEmployees('MECHANICIAN', 'MANAGER'));
System.Object
Devart.Data.Oracle.OracleArray
Devart.Data.Oracle.OracleTable