Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

II. Solutions > 7. Nested Tables

Chapter 7. Nested Tables

Beginner

Q:

7-1.

The syntax for creating a nested table is similar to that for an index-by table:

TYPE type name IS TABLE OF element datatype [NOT NULL];

For example, here’s the command to create a nested table type called a_simple_udt_t; its elements consist of numeric data, each with no more than 10 digits:

CREATE TYPE a_simple_udt_t IS TABLE OF NUMBER(10);

Q:

7-2.

The statements are:

  1. True. Nested table types can indeed be used as datatypes for Oracle tables as in this DDL:

    SQL> CREATE TABLE a_table (
      2    col1 number,
      3    col2 a_simple_udt_t )
      4  NESTED TABLE col2 STORE AS a_table_col2;
    
    Table created.

    The NESTED TABLE clause specifies the name of the table used to store the data in the nested column.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint