5.寫一個存儲過程? 輸入: 部門編號? 查出該部門的人,工資比ADAMS高,則提成增加100, 比ADAMS低,則提成增加200? 顯示提成增加后的員工信息create or replace procedure a_sc(i_deptno number)iscursor c_emp is select * from emp where deptno=i_deptno;l_sal number;a_sal number;l_commnew number;begin? select sal into l_sal from emp where deptno=i_deptno;? select sal into a_sal from emp where deptno=i_deptno and ename='ADAMS';? if l_sal > a_sal then ??? update emp2 set comm=comm+100 where deptno=i_deptno??? returning comm into l_commnew;??? else ????? update emp2 set comm=comm+200 where deptno=i_deptno????? returning comm into l_commnew;?? end if;?? for v_emp in c_emp loop???? dbms_output.put_line('姓名:'||v_emp.ename);???? end loop;end;
- 0 回答
- 0 關注
- 1167 瀏覽
添加回答
舉報
0/150
提交
取消