<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=Oracle_PL%2FSQL_Tutorial%2FCollections%2FIntroduction</id>
		<title>Oracle PL/SQL Tutorial/Collections/Introduction - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://sqle.ru/index.php?action=history&amp;feed=atom&amp;title=Oracle_PL%2FSQL_Tutorial%2FCollections%2FIntroduction"/>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/Collections/Introduction&amp;action=history"/>
		<updated>2026-04-06T18:59:39Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/Collections/Introduction&amp;diff=2907&amp;oldid=prev</id>
		<title> в 13:45, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/Collections/Introduction&amp;diff=2907&amp;oldid=prev"/>
				<updated>2010-05-26T13:45:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 13:45, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/Collections/Introduction&amp;diff=2908&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://sqle.ru/index.php?title=Oracle_PL/SQL_Tutorial/Collections/Introduction&amp;diff=2908&amp;oldid=prev"/>
				<updated>2010-05-26T10:04:19Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Collections stores sets of elements==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There are three types of collections:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Varrays,Nested tables,Associative arrays (formerly known as index-by tables)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A varray is similar to an array in Java.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can use a varray to store an ordered set of elements having an index associated with it.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The elements in a varray are of the same type.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A varray has one dimension.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A varray has a maximum size that you set when creating it.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Elements in a varray can only be modified as a whole, not individually.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can change the size of a varray later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The elements stored in a varray are stored with the table when the size of the varray is 4KB or less, otherwise the varray is stored outside of the table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When a varray is stored with the table, accessing its elements is faster than accessing elements in a nested table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A nested table is a table that is embedded within another table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can insert, update, and delete individual elements in a nested table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Because you can modify individual elements in a nested table, this makes them more flexible than a varray.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A nested table doesn&amp;quot;t have a maximum size, and you can store an arbitrary number of elements in a nested table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The elements for nested tables are stored in separate tables.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Associative arrays is formerly known as index-by tables.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An associative array is a set of key and value pairs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You can get the value from the array using the key (which may be a string) or an integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An associative array is similar to a hash table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You create a collection type using the SQL DDL CREATE TYPE statement.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Then you can use these types to define columns in a table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An associative array is a PL/SQL construct, not a SQL construct.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;An associative array cannot be stored persistently in a table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;You might be asking yourself why you would want to use collections in the first place.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;After all, using two tables with a foreign key already allows you to model relationships between data.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The answer is that the data stored in the collection may be accessed more rapidly by the database than if you were to use two tables instead.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Typically, you&amp;quot;ll want to use a collection if you have data that is only used by one table.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Quote from:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Oracle Database 10g SQL (Osborne ORACLE Press Series) (Paperback)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;# Paperback: 608 pages&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;# Publisher: McGraw-Hill Osborne Media; 1st edition (February 20, 2004)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;# Language: English&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;# ISBN-10: 0072229810&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;# ISBN-13: 978-0072229813&amp;lt;/p&amp;gt;&lt;br /&gt;
26. 1. Introduction&lt;br /&gt;
26. 1. 1. &lt;br /&gt;
Collections stores sets of elements&lt;br /&gt;
26. 1. 2. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/MultilevelCollectionTypes.htm&amp;quot;&amp;gt;Multilevel Collection Types&amp;lt;/a&amp;gt;&lt;br /&gt;
26. 1. 3. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/ListofCollectionmethods.htm&amp;quot;&amp;gt;List of Collection methods&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== List of Collection methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A series of collection methods can be used to determine the size, and the rows populated, in any collection datatype: index-by tables, VARRAYs, and nested tables. &lt;br /&gt;
The following is a list of the collection methods and their purposes:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;EXISTS(row) returns TRUE if the row specified exists.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;COUNT returns the number of rows.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;FIRST returns the row number of the first populated row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;LAST returns the row number of the last populated row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;PRIOR(row) returns the row number of the last row populated before the row specified.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;NEXT(row) returns the row number of the next row populated after the row specified.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;DELETE removes all rows.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;DELETE(row) removes the specified row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;DELETE(start_row,end_row) removes all rows between and including the start_row and end_row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;TRIM removes the last row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;TRIM(n) removes the last n rows.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;EXTEND adds one row.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;EXTEND(n) adds n rows.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;EXTEND(n,m) adds n copies of row m.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
26. 1. Introduction&lt;br /&gt;
26. 1. 1. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/Collectionsstoressetsofelements.htm&amp;quot;&amp;gt;Collections stores sets of elements&amp;lt;/a&amp;gt;&lt;br /&gt;
26. 1. 2. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/MultilevelCollectionTypes.htm&amp;quot;&amp;gt;Multilevel Collection Types&amp;lt;/a&amp;gt;&lt;br /&gt;
26. 1. 3. &lt;br /&gt;
List of Collection methods&lt;br /&gt;
&lt;br /&gt;
== Multilevel Collection Types==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A collection type whose elements are also a collection type is known as a multilevel collection type.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following list shows the valid multilevel collection types:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;A nested table containing a nested table type&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;A nested table containing a varray type&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;A varray containing a varray type&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;A varray containing a nested table type&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;A varray or nested table of an object type that has an attribute that is a varray or nested table type&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
26. 1. Introduction&lt;br /&gt;
26. 1. 1. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/Collectionsstoressetsofelements.htm&amp;quot;&amp;gt;Collections stores sets of elements&amp;lt;/a&amp;gt;&lt;br /&gt;
26. 1. 2. &lt;br /&gt;
Multilevel Collection Types&lt;br /&gt;
26. 1. 3. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/Oracle/0520__Collections/ListofCollectionmethods.htm&amp;quot;&amp;gt;List of Collection methods&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>