what are %TYPE and %ROWTYPE? what is the difference?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / srikanth
%type can hold one perticular variable
%rowtype decalre total row declaration
| Is This Answer Correct ? | 11 Yes | 2 No |
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 |
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 |
what is the difference between where clause and having clause? : Sql dba
Can a foreign key be a duplicate?
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
What is rowid in sql?
How do you truncate?
i have a table emp and columns ename,empno,mgr_id,i need ename,manager name as result i.e employee respective manager.. example empno ename mgr_id 1 john 3 2 paul 3 3 smith 1 4 kevin 1 5 stewart 2 result has to look like this ename manager john smith paul smith smith john kevin john stewart paul can u plz help me out in this.....
What do we need to check in database testing?
What is difference between mysql and postgresql?
Can sql function call stored procedure?
How to display all Friday's in a year with date?
explain access control lists. : Sql dba
Can we use distinct and group by together?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)