现在要实现一个业务逻辑,就是将记录选取出来后在一个字段的值的前后加上一些内容,比如一个在ABC两端加字符串内容使之变成head.ABC.tail,使用存储过程来完成,其中在进行游标的操作时update语句提示错误,弄不明白
我的存储过程如下,可以创建,但是使用call procedure_name 的方式调用时报错,本人新手,望高手不吝赐教
create or replace procedure tbi_test_prec is
cursor tempcur is select testname from tbi_test;
temp varchar2(50);
begin
open tempcur;
loop
fetch tempcur into temp;
update tbi_test set testname = 'bu.' +substr(temp,1,4) +'.' +substr(temp,5) where testname=temp;
exit when tempcur%NOTFOUND;
end loop;
end;调用语句
call tbi_test_prec()
我的存储过程如下,可以创建,但是使用call procedure_name 的方式调用时报错,本人新手,望高手不吝赐教
create or replace procedure tbi_test_prec is
cursor tempcur is select testname from tbi_test;
temp varchar2(50);
begin
open tempcur;
loop
fetch tempcur into temp;
update tbi_test set testname = 'bu.' +substr(temp,1,4) +'.' +substr(temp,5) where testname=temp;
exit when tempcur%NOTFOUND;
end loop;
end;调用语句
call tbi_test_prec()
call tbi_test_prec()--
我一般用toad测试begin
tbi_test_prec;
end;