/*
为指定的职工在原工资的基础上长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;
/