Nest records, access the names of the nested records by using another component selector, or period : Record Data Type « PL SQL « Oracle PL / SQL






Nest records, access the names of the nested records by using another component selector, or period

    
SQL>
SQL> DECLARE
  2    TYPE full_name IS RECORD(first VARCHAR2(10 CHAR) := 'John',last VARCHAR2(10 CHAR):= 'Taylor');
  3    TYPE demo_record_type IS RECORD(id NUMBER DEFAULT 1, contact  FULL_NAME);
  4    demo DEMO_RECORD_TYPE;
  5  BEGIN
  6    dbms_output.put_line('['||demo.id||']');
  7    dbms_output.put_line('['||demo.contact.first||']['||demo.contact.last||']
  8  END;
  9  /
ERROR:
ORA-01756: quoted string not properly terminated

   
    
    
    
  








Related examples in the same category

1.PL/SQL Collections: record type
2.The %ROWTYPE can also be used to create a record based on the structure of a cursor
3.A simple record that holds a person's name, phone number, and birth date and fill data in
4.Declare the record data type
5.Load a row in table to record type
6.A record is populated using a SELECT statement
7.declare record with not null attribute
8.Assign a wrong record type
9.This block shows legal and illegal record assignments.
10.How to select into a record.
11.Select into Records
12.Record type
13.Using explicit definition to define record types and a compound record type; and, the use of nested types