日期:2014-05-16 浏览次数:20431 次
create or replace procedure proc(myDeptno in number) is myEname varchar2(10); mySal number(7,2); myHiredate date; myGrade number(2); cursor mycursor is select ename,sal,hiredate,salgrade.grade into myEname,mySal,myHiredate,myGrade from emp join salgrade on sal between salgrade.losal and salgrade.hisal where emp.deptno=myDeptno; begin open mycursor; loop fetch mycursor into myEname,mySal,myHiredate,myGrade; exit when mycursor%notfound; dbms_output.put_line('员工姓名'||myEname||' '||'员工工资'||mySal||' '||'入职时间'||myHiredate||' '||'工资等级'||myGrade); end loop; close mycursor; end; /