Skip to main content

PL/SQL program of cursor using rowtype



declare
  cursor c1 is
    select first_name, salary, employee_id from employee;
  c2_cur c1%rowtype;
begin
  open c1;
  loop
    fetch c1
      into c2_cur;
    exit when c1%notfound;
    dbms_output.put_line(c2_cur.first_name || c2_cur.employee_id ||
                         c2_cur.salary);
  end loop;
  end;

Comments

Popular posts from this blog

Pl/SQL program to find square of a user input number Using Function

declare   value1 number;   value2 number;   mytotal number;   function myfun(myval1 in number, myval2 in number) return number is     total number;   begin     total := myval1 ** myval2;     dbms_output.put_line(total);     return total;   end; begin   value1 :=&val1;   value2 := &val2;  mytotal:= myfun(value1, value2); end;