Oralce if ..elsif结构
create or replace procedure sp_pro6(spNo number) is v_job emp.job%type; begin select e.job into v_job from emp e where empno=spNo; if v_job='PRESIDENT' then update emp set sal=sal+1000 where empno=spNo; elsif v_job='MANAGER' then update emp set sal=sal+500 where empno=spNo; else update emp set sal=sal+200 where empno=spNo; end if; end; v_job参数的数据类型跟emp表的job字段类型一样,这样,你修改这个表的ID字段类型,就不用改存储过程了