| 1 comments ]

APPLYING COMPOSITE DATATYPES IN PL/SQL:


        a) The Composite datatypes in PL/SQL are also called as COLLECTIONS.
        b) The types of composite datatypes in  PL/SQL are
                       * RECORD  *TABLE  *NESTED TABLE  *VARRAY

PL/SQL RECORDS:

      
        a) A RECORD is a group of related data items stored in Fields, each with its own Name and Datatype.
        b) When a RECORD TYPE of fields in declared then they can be manipulated as a Unit.
        c) The Points to Note are:
                -> Each record defined can have as many fields as necessarily.
                -> Records can be assigned initial values and can be defined as NOT NULL.
                -> Fields without initial values are initialized to NULL.
                -> The DEFAULT keyword can be used when defining fields.
                -> RECORD Types can be declared as user define records in the declaritive part of any block.
                -> We can declare and reference nested records. A recoed can be the component of another record.

              Syntax:
                       TYPE Type_Name IS RECORD
                                      (Field_declaration[,Field_declaration]....);
                       Identifier Type_Name;
          
              * WHERE Field_Declaration is:
                     
                       Field_Name{Field_Type| Variable%TYPE | Table.Column%TYPE| Table%ROWTYPE}
                                 [[ NOT NULL]
                                   { :=|DEFAULT}Expr]

1 comments

Anonymous said... @ March 29, 2012 3:47 PM

example pls

AddThis

| More
Widget By Devils Workshop