日期:2014-05-16 浏览次数:20459 次
--程序段2-----------------------------------------------------
? open advance_sal(in_min_sal);
? fetch advance_sal
??? into advance_sal_record;
? while (advance_sal%found) loop
??? update emp e
?????? set e.sal = in_min_sal
???? where e.empno = advance_sal_record.empno;
??? fetch advance_sal
????? into advance_sal_record;
? end loop;
? dbms_output.put_line('有' || advance_sal%rowcount ||
?????????????????????? '名员工的工资低于最低工资,已经都被加到了最低标准');
? close advance_sal;
? dbms_output.put_line('调整最低工资标志后所有的员工信息如下:----------------------------------------');
? open emp_cursor;
? --使用简单loop循环获取数据
? loop
??? --注意是fetch 游标 into 记录类型 ,不要搞反了啊
??? fetch emp_cursor
????? into emp_record;
??? exit when emp_cursor%notfound;
??? dbms_output.put_line('员工编号:' || emp_record.empno || '? 员工名字:' ||
???????????????????????? emp_record.ename || '? 员工职位:' || emp_record.job ||
???????????????????????? ' 员工入职日期:' || emp_record.hiredate || ' 员工部门号:' ||
???????????????????????? emp_record.deptno||'?? 员工工资:'||emp_record.sal);
? end loop;
? close emp_cursor;