%ROWTYPE is used to associate a variable with an entire table row.
it provides the data type of a variable or a database column to that variable.
%TYPE is used to associates a variable with a single column type.
it provides the record type that represents a entire row of a table or view or columns selected in the cursor.
it provides the data type of a variable or a database column to that variable.
Syntax :%TYPE attribute
Ex. DECLARE
books_printed NUMBER (6);
books_sold books_printed%TYPE ;
maiden_name emp.ename%TYPE ;
%TYPE is used to associates a variable with a single column type.
it provides the record type that represents a entire row of a table or view or columns selected in the cursor.
Syntax : %ROWTYPE attribute
Ex. DECLARE
dept_row dept%ROWTYPE ;
Advantages- need not know about variable's data type.
- If the database definition of a column in a table changes, the data type of a variable changes accordingly.
PL/SQL objects (such as variables and constants) and database objects(such as col. and tables )are associated with certain attributes.
No comments:
Post a Comment