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

does sql support programming? : Sql dba

603


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

535


What is a data definition language?

548


What are the parts of a basic sql query?

507


What are the types of sql commands?

544






How can we solve sql error: ora-00904: invalid identifier?

695


Is time a data type in sql?

474


What is sql partition?

546


how to shut down the server with 'mysqladmin'? : Sql dba

537


How do you concatenate in sql?

545


What is output spooling in sql*plus?

544


what is a composite primary key ? : Sql dba

576


What are the different ddl commands in sql?

574


what are the differences between binary and varbinary? : Sql dba

528


How do you exit in sql?

583