Wednesday, 12 October 2011

VarrayNested Table (Difference)

{\rtf1\ansi\ansicpg1252\deff0\deflang16393{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Calibri;}}
{\colortbl ;\red51\green51\blue51;}
{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}{\s3 heading 3;}{\s4 heading 4;}{\s5 heading 5;}{\s6 heading 6;}{\s7 heading 7;}{\s8 heading 8;}{\s9 heading 9;}}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\keepn\s8\fi720\lang1033\b\f0\fs22\par
\pard\fi-360\li2160\tx2160\b0 An array is an ordered set of data elements.\par
All elements of a given array are of the same datatype.\par
Each element has an index, which is a number corresponding to the element's position in the array.\par
The number of elements in an array is the size of the array.\par
Oracle allows arrays to be of variable size, which is why they are called VARRAYs. You must specify a maximum size when you declare the array type.\par
\pard\li720 Creating an array type does not allocate space. It defines a datatype, which you can use as\par
\pard\fi-360\li2160\tx2160 The datatype of a column of a relational table.\par
An object type attribute \par
A PL/SQL variable, parameter, or function return type.\cf1\par
\pard\li720\par
\cf0 A VARRAY is normally stored in line, that is, in the same tablespace as the other data in its row. \par
\pard\fi720\b Nested\b0 \b Tables\b0\par
\pard\li1440 A nested table is an unordered set of data elements, all of the same datatype. It has a single column, and the type of that column is a built-in type or an object type. If an object type, the table can also be viewed as a multi-column table, with a column for each attribute of the object type.\par
A table type definition does not allocate space. It defines a type, which you can use as\par
\pard\fi-360\li2160\tx2160 The datatype of a column of a relational table. \par
An object type attribute.\par
A PL/SQL variable, parameter, or function return type\par
\pard\li1440\par
When a table type appears as the type of a column in a relational table or as an attribute of the underlying object type of an object table, Oracle stores all of the nested table data in a single table, which it associates with the enclosing relational or object table.\par
\pard\keepn\s9\fi720\b Differences between Nested Tables and Varrays\par
\pard\fi720\b0\par
\v\par
\pard\v0 Nested tables differ from varrays in the following ways:\par
\par
\pard\fi-360\li1800\tx1800 Varrays have a maximum size, but nested tables do not.\par
Varrays are always dense, but nested tables can be sparse. So, you can delete individual elements from a nested table but not from a varray.\par
Oracle stores varray data in-line (in the same tablespace). But, Oracle stores nested table data out-of-line in a store table, which is a system-generated database table associated with the nested table.\par
When stored in the database, varrays retain their ordering and subscripts, but nested tables do not.\par
\pard\sa200\sl276\slmult1\lang9\f1\par
}

No comments:

Post a Comment