Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Oracle varray columns (Read 2092 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Oracle varray columns
08.03.10 at 14:18:37
Oracle varray columns
Oracle varray's or varying arrays are collections that can store arrays of particular elements with a row of data. Varrays are not widely used as storage in tables but sometimes are used in PL/SQL constructs. Inline tables are often preferred for 'inline arrays'.
As an example consider the following situation.  
First a type is created: a varying array of 10 numbers.
Then a table is created using the varray column type.
Next two rows are inserted into the table.
create type t_varray as varray(10) of number;/tt]
[tt]create table myvarray (a number, v t_varray);/tt]
ert into myvarray (a, v) values (1,t_varray(1,2,3,4,5,6,7,8,9,10));/tt]
ert into myvarray (a,v) values (2,t_varray(1,2,3,4,5));
Retrieving varray data:
Selecting from a table with varrays may cause problems. Depending on which driver you use the data retrieval will be possible.
select * from myvarray;
This query works fine with OO4O (Oracle Objects for OLE) but it fails with the following providers/drivers:
MSDAORA : Microsoft OLE DB Provider for Oracle
MSDASQL : Microsoft ODBC provider
OraOLEDB.Oracle: Oracle OLE DB Provider for Oracle
See also:
Oracle PL/SQL programming, chapter 19. Nested Tables and VARRAYs
Back to top
« Last Edit: 08.03.10 at 14:59:07 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1