相关代码 |
|
create or replace procedure emp_cur is R_emp EMP%ROWTYPE; CURSOR c_emp IS SELECT * FROM emp; --从scott的emp表中取出各雇员的信息。 BEGIN OPEN c_emp; --循环输出雇员信息 LOOP FETCH c_emp INTO r_emp; EXIT WHEN c_emp%NOTFOUND; DBMS_OUTPUT.PUT_LINE ('Salary of Employee '||r_emp.ename || ' is '||r_emp.sal); END LOOP; CLOSE c_emp; END;