Explain the purpose of %type and %rowtype data types with the example?



Explain the purpose of %type and %rowtype data types with the example?..

Answer / Ravindra Kumar Sagar

%TYPE is a PL/SQL construct that creates a variable of the same type as an existing database object (column, table, or package). %ROWTYPE is a PL/SQL record type corresponding to a table in the database. Example:DECLARE v_student student%rowtype; BEGIN SELECT * INTO v_student FROM student WHERE id = 1; END;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is the non-clustered index in sql?

1 Answers  


Explain how can you save or place your msg in a table?

1 Answers  


need to split a string into separate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

2 Answers  


what is a tablespace? : Sql dba

1 Answers  


Why are indexes and views important to an organization?

1 Answers  


discuss about myisam key cache. : Sql dba

1 Answers  


What is primary key secondary key alternate key candidate key?

1 Answers  


Can we perform dml on view?

1 Answers  


Is id a reserved word in sql?

1 Answers  


How can I create a table from another table without copying any values from the old table?

8 Answers  


What is a stored procedure in sql with example?

1 Answers  


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

1 Answers  


Categories