Answered Questions

  • What is difference between % ROWTYPE and TYPE RECORD ?

     %  ROWTYPE  is to be used whenever query returns a entire row of a table or view. TYPE  rec  RECORD is to be used whenever query returns columns of differenttable or views and variables.      E.g.  TYPE  r_emp is RECORD (eno emp.empno% type,ename emp ename %type);     e_rec emp% ROWTYPE     cursor...

    Nupur

    • Apr 30th, 2015

    This is my understanding: Declare : eno employee.emp_id%type - specifically tells you that the variable type or data that it will be holding will be same as th e employee_id type in the employee tabl...

    Nupur

    • Apr 24th, 2015

    When we declare a var as %row type, then the variable holds all the column type attributes. Developer does not need to know what the individual column types are. Type record is used when we declare a variable to be of the records of the table. 

  • What  are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?

     %  TYPE  provides  the data type of a variable or a database column to that variable. % ROWTYPE  provides the record type that represents a entire row of a table or view or columns selected in the cursor. The advantages are : I. Need not  know about variable's data typeii.  If  the  database  definition of a column in a table changes, the...

    PRADEEP

    • Oct 16th, 2012

    %rowtype is associated entire table(if we want to declare all columns then we need to declare %rowtype).

    %type is associated with one column .(if we want to declare entire column then we need to declare %type).

    Yaseen

    • Aug 9th, 2012

    If using %type and %rowtype , no need to know the the data type of the table column . and once the development is finished , the type of column is changed it will not effect the coding.