WHAT IS RECORD ? Record is a composite data structure which hold data items of different kinds.Record consist of different fields similar to a row of data base table. 1)table base 2)cursor base record 3)user defined record To create table base or cursor base record we prefer % row type attribute which provide record type to represent a rows in data base table.record can stored rows from data base table or fetch from cursor variable and cursor. e.g of table base declare v_rc employees.%rowtype; begin select * into v_rc from emolyees where employee_id=100; dbms_output.put_line('employees details:'||'v_rc.last_name||v_rc.first_name||v_rc.salary); end; 2)cursor base record declare cursor c_rec_emp is select last_name,employee_id,salary from employees v_c_r c_rec_emp.%rowtype; begin open c_rec_emp; loop fetch c_rec_emp into v_c_r; exit when c_rec_emp %notfound; dbms_output.put_line('employee datails:'||v_c_r.last_name||v_c_r.employee_id||v_c_r...
Comments
Post a Comment