很久没有写存储过程了,08,09年的时候接触过
现在不得不对出现的问题进行分析修改,练习下存储过程的写法
create or replace procedure testpr is
i number;
va number;
begin
i := 1;
if i = 1 then
select instr('2011/9/1', '/') into va from dual;
if va > 0 then
va := va + 1;
insert into testinstr values(va);
commit;
else
insert into testinstr values(0);
commit;
end if;
else
insert into testinstr values(-1);
commit;
end if;
end testpr;
create or replace procedure testpr is
i number;
va number;
begin
i := 1;
if i = 1 then
select instr('2011/9/1', '/') into va from dual;
if va > 0 then
va := va + 1;
insert into testinstr values(va);
commit;
else
insert into testinstr values(0);
commit;
end if;
else
insert into testinstr values(-1);
commit;
end if;
end testpr;