Explain the purpose of %TYPE AND %ROWTYPE data types?

devquora
devquora

Posted On: Feb 22, 2018

 

%TYPE- The %TYPE lets you declare a constant, variable, collection element, etc as previously declared variable or column. It is an attribute which is used for anchoring. Example- the variable m_empno has same data type as the column empno in table emp.

%ROWTYPE- the %Rowtype attribute lets you declare a record that represents a row in the table.  The fields of the row have same name and data types as column in the view. Example- dept_rec dept%ROWTYPE . This declares a record that can store an entire row for DEPT table.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PL/SQL Interview Questions

    What is PL/SQL?

    PL/SQL stands for Procedural Language extension of Structured Query Language (SQL). It is a block-structured language ha..

    PL/SQL Interview Questions

    Differentiate between PL/SQL and SQL?

    PL/SQL is Oracle’s Procedural Language SQL which allows you to write full programs to execute options like insert/ sel..

    PL/SQL Interview Questions

    State few characteristics of PL/SQL?

    Some of the characteristics of PL/SQL are furnished below: PL/SQL is completely portable as code can be executed on any ..