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 ?    81 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 ?    34 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

if a string is there like s1,s2,s3,s4.How to find count of commas in this.

4 Answers  


what command is used to create a table by copying the structure of another table including constraints ?

6 Answers   eicc, CMC,


Use The Implicit cursor to Query The Department table information Where Deptno is 30.check,if no record was found then print "Record Was Not Found".Else Print Deptname And Ename.Dept table Have Dname Varchar2(20),Deptno Number,EnameVarchar2(20).Please Answer In 2 mins,with in Maximum 15 lines.

5 Answers   Wipro,


What are the datatypes a available in PL/SQL ?

2 Answers  


how can we replace the particular column value of a resulted set of executed query? I mean write down a sql query to chane the particular column's value of a resulted set of executed query

3 Answers  






I Have A Table Like This. Cityno Cityname Mails 1 Bangalore 8km 2 Hsr Layout 20km 3 Mejistic 30km 4 Jayadeva 55km 5 Itpl 80km 6 Hebbal 115km I Have Data Like This I Want O/p Like This Distance No.ofcity 0-50km 3 51-100km 2 101-150km 4 And So On

6 Answers   HCL, Oracle, DELL,


four procedures is are there should i write their in a package

2 Answers  


How can I pass the inner procedure value to outer procedure ?

2 Answers  


what is inline command?

2 Answers  


How is Oracle 10g helpful when compared to oracle 9i and what is grid computing

1 Answers   Flextronics,


What is the Difference between Procedure and Function.Can we call a Function in a DML?

2 Answers   TCS,


what is the boundary line in varrays?

1 Answers   HCL,






Categories