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

Answers were Sorted based on User's Feedback



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

Answer / pavan_1981

these two are used with cursors to store the returing
result from the query.
%TYPE:a variable is declared to be of %type when we are
referring to a single specific column.when we declare a
variable to be of %type of a column,the variable datatype
becomes the datatype of that column..here it can only one
datatype that of the column.

%ROWTYPE:same as above but takes a single row at a time and
can accomidate multiple datatypes.it can store whole row at
a time containing different datatypes.

Is This Answer Correct ?    83 Yes 2 No

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

Answer / lakshminarayana reddy

%Type:- used to variable according to column sturcture
%Rowtype:- used to variable accordin to compleat record
sturcture.

Is This Answer Correct ?    35 Yes 5 No

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

Answer / 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

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

Answer / debasis dutta

%type is associates a variable with column data of a table..
ex..
empno emp_mast.eno%type;
%rowtype is associates a variable with whole table data of
a database..
ex
tot emp_mast%rowtype;

Is This Answer Correct ?    13 Yes 3 No

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

Answer / srikanth

%type can hold one perticular variable
%rowtype decalre total row declaration

Is This Answer Correct ?    11 Yes 2 No

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

Answer / hjhjnj

Column Type (i.e. %TYPE) is used to declare a field with the same type as that of a specified table’s column

Row type (i.e. %ROWTYPE) is used to declare a record with the same types as found in the specified database table, view or cursor

Is This Answer Correct ?    7 Yes 1 No

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

Answer / vikneswaran

%type is used to declare variable for one column in the table
%type is used to declare variable for entire table

Is This Answer Correct ?    7 Yes 14 No

Post New Answer

More SQL PLSQL Interview Questions

What are user defined functions?

0 Answers  


what is 'trigger' in sql? : Sql dba

0 Answers  


How would you go about increasing the buffer cache hit ratio? 0. Explain the difference between a hot backup and a cold backup and the benefits associated with each 1. You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? 2. How do you switch from an init.ora file to a spfile? 3. Explain the difference between a data block, an extent and a segment. 4. Give two examples of how you might determine the structure of the table DEPT. 5. Where would you look for errors from the database engine? 6. Compare and contrast TRUNCATE and DELETE for a table. 7. Give the reasoning behind using an index. 8. Give the two types of tables involved in producing a star schema and the type of data they hold. 9. What type of index should you use on a fact table? 10. Give two examples of referential integrity constraints. 11. A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? 12. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. 13. What command would you use to create a backup control file? 14. Give the stages of instance startup to a usable state where normal users may access it. 15. What column differentiates the V$ views to the GV$ views and how? 16. How would you go about generating an EXPLAIN plan?

2 Answers  


what are wild cards used in database for pattern matching ? : Sql dba

0 Answers  


What is a variable in sql?

0 Answers  






How many rows will return from dual table?

4 Answers   Fujitsu,


What is user in sql?

0 Answers  


How does postgresql compare to mysql?

0 Answers  


How delete all data from all tables in sql?

0 Answers  


what is denormalization. : Sql dba

0 Answers  


What is a natural join?

0 Answers  


What are the different types of triggers?

0 Answers  


Categories