ITeye博客

存储过程

yxx676229549 · 2012-02-02 00:09 · oracle · 编程语言 · Markdown

存储过程,弄了一个多小时,哎终于解决,原来变量写错,郁闷,不够细心啊

create or replace procedure sp_student(stuname in varchar2) is
v_sal student.sal%type;
begin
select sal into v_sal from student where name = stuname;
if v_sal>1000 then
update student set sal = sal-100 where name = stuname;
else 
update student set sal = sal+100 where name = stuname;
end if;
end;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。