Loading
 
What's Next: View All Tutorial →

%RowType Attribute & %Type Attribute

%TYPE Declare a variable according to: – A database column definition – Another previously declared variable Prefix %TYPE with: – The database table and column – The previously declared variable name Syn...

Published Date: 25/08/2014  Last Modified Date: 25/08/2014    New Post



%TYPE

Declare a variable according to:
– A database column definition
– Another previously declared variable
Prefix %TYPE with:
– The database table and column
– The previously declared variable name

Syntax:

identifier		Table.column_name%TYPE;

Example:

...
  v_name           empl.name%TYPE;
  v_bal 		       NUMBER(7,2);
	  v_min_bal    v_bal%TYPE := 10;
...		

%ROWTYPE

  1.  Declare a variable according to a collection of columns in a  database table or view.
  2.  Prefix %ROWTYPE with the database table.
  3.  Fields in the record take their names and data types from   the columns of  the table or view.

Example:

Declare a variable to store the information about an employee from the EMPLOYEES table
	empl_rec		empl%ROWTYPE;        
Awaiting for Administrator approval




← Back to list


Related Post




×