O'Reilly logo

Oracle® PL/SQL® Interactive Workbook, Second Edition by Elena Silvestrova, Benjamin Rosenzweig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lab 19.2 Nested Records

Lab Objective

After this Lab, you will be able to:

Use Nested Records

As mentioned in the introduction to this chapter, PL/SQL allows you to define nested records. These are records that contain other records and collections. The record that contains a nested record or collection is called an enclosing record.

Consider the following code fragment.

FOR EXAMPLE

DECLARE 
   TYPE name_type IS RECORD 
      (first_name VARCHAR2(15), 
       last_name VARCHAR2(30)); 

   TYPE person_type IS 
      (name name_type, 
       street VARCHAR2(50), 
       city VARCHAR2(25), 
       state VARCHAR2(2), 
       zip VARCHAR2(5)); 

   person_rec person_type; 

This code fragment contains two user-defined record types. The second user-defined record type, person_type, is a nested record type because ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required