alt
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow Oracle 9i arrow Tutorial 12: Oracle 9i: PL/SQL Collections
Site Search


Tutorial 12: Oracle 9i: PL/SQL Collections
Article Index
Tutorial 12: Oracle 9i: PL/SQL Collections
Page 2

Creating Nested Tables

The following example explain how to create a table type and then nest it in a table



Following syntax is used to display columns of the above table we write.

SQL > SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS;
SQL > SELECT TYPECODE, ATTRIBUTES FROM USER_TYPES;

TYPECODE ATTRIBUTES
------------------------------ ----------
OBJECT 2
COLLECTION 0

To insert values into the above table we use the below given syntax

To query a nested table Oracle provides a new function THE. To select data from a field in the nested table we must have to flatten the table first. Function THE is used for this purpose.

Associative arrays (or) Index-by tables:

They are sets of key-value pairs. The keys are maintained unique. The key can be either an integer or a string. The unique key is created using primary key from a table. The types raw , longraw , rowid etc are not allowed as keys.

Creating Associative Arrays


Trackback(0)
Comments (3)add comment

Imtiaz ali said:

  Associate arrays or Index-by table is not understandable. This is the only topic found difficult to understand otherwise complete tutorial is fine.
May 30, 2007

arulkumar said:

  i'm beginner to oracle .it ll be very useful for beginners like me
August 16, 2007

bharat kumar said:

  im a beginner of oracle and these sessions are really great for people like me to get about basics
November 27, 2007

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape