what are %TYPE and %ROWTYPE? what is the difference?

Answer Posted / p.rajasekar

%RowType
1.%ROWTYPE is used to declare a record with the same types
as found in the specified database table, view or cursor.
Example:
DECLARE
v_EmpRecord emp%ROWTYPE;
2.Whenever we change the datatype in database,No need to
change in Application code using the %RowType, because
It will automatically take care of the dtatype change
%Type
1.%TYPE is used to declare a field with the same type as
that of a specified table's column. Example:
DECLARE
v_EmpNo emp.empno%TYPE;
2.Whenever we change the datatype in database,No need to
change in Application code using the %RowType, because
It will automatically take care of the dtatype change

Is This Answer Correct ?    25 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are stored procedures faster than queries?

524


what is self join and what is the requirement of self join? : Sql dba

685


What is dbo in sql?

536


What is sql and its types?

625


What is data control language?

532






What are all ddl commands?

551


How does one use sql*loader to load images, sound clips and documents? : aql loader

674


Where is pl sql used?

521


how to delete an existing column in a table? : Sql dba

554


What is cursor in pl sql with examples?

481


what is rdbms? : Sql dba

583


How do I view output in sql developer?

578


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

623


what is dbms? : Sql dba

544


Explain the difference between triggers and constraints?

521