为指定的职工在原工资的基础上长10%的工资,并打印涨工资前和涨工资后的工资
生活随笔
收集整理的這篇文章主要介紹了
为指定的职工在原工资的基础上长10%的工资,并打印涨工资前和涨工资后的工资
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*
為指定的職工在原工資的基礎上長10%的工資,并打印漲工資前和漲工資后的工資
select sal into psal from emp where empno=?
update emp set sal = sal * 1.1 where empno =?
*/
create or replace PROCEDURE raiseSalary(eno in number)
as
? psal emp.sal% TYPE;--保存員工工資
begin
? --查出該員工的工資
? select sal into psal from emp where empno=eno;
?
? --為其漲工資
? update emp set sal = sal * 1.1 where empno =eno;
? --提交
? commit;
?
? --打印
? dbms_output.put_line('漲工資前:' || psal);
? dbms_output.put_line('漲工資后:' || (psal*2));
end;
/
為指定的職工在原工資的基礎上長10%的工資,并打印漲工資前和漲工資后的工資
select sal into psal from emp where empno=?
update emp set sal = sal * 1.1 where empno =?
*/
create or replace PROCEDURE raiseSalary(eno in number)
as
? psal emp.sal% TYPE;--保存員工工資
begin
? --查出該員工的工資
? select sal into psal from emp where empno=eno;
?
? --為其漲工資
? update emp set sal = sal * 1.1 where empno =eno;
? --提交
? commit;
?
? --打印
? dbms_output.put_line('漲工資前:' || psal);
? dbms_output.put_line('漲工資后:' || (psal*2));
end;
/
總結
以上是生活随笔為你收集整理的为指定的职工在原工资的基础上长10%的工资,并打印涨工资前和涨工资后的工资的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 触发器应用场景一: 根据业务逻辑限制某些
- 下一篇: 地方政府向异地政府推送就业人员这好推送吗