代码:create or replace procedure update_oa_temp_tab is CURSOR body_code IS select b.ITEM219,b.vol_id from oa_temp_tab a, OA_DOCVIEW_TAB b where trim(a.code) = trim(b.ITEM219); begin for curr_code in body_code loop update oa_temp1_tab set vol_id = curr_code.vol_id where trim(code) = trim(curr_code.ITEM219); end loop; end update_oa_temp_tab;
加上COMMIT; ... end loop; COMMIT; end update_oa_temp_tab; ...
拜托,问问题也讲究个方法没有存储过程代码,没有exec的command.....怎么找问题
然后在代码中加一些dbms_output.putline('')看看执行的过程是否正常
CURSOR body_code IS
select b.ITEM219,b.vol_id
from oa_temp_tab a, OA_DOCVIEW_TAB b
where trim(a.code) = trim(b.ITEM219);
begin
for curr_code in body_code loop
update oa_temp1_tab
set vol_id = curr_code.vol_id
where trim(code) = trim(curr_code.ITEM219);
end loop;
end update_oa_temp_tab;
...
end loop;
COMMIT;
end update_oa_temp_tab;
...
话你运行后在procedures里有这个存储过程。你打开它重新编辑一下,如果有错的话,就会提示错误的。
编译成功后,exec 过程名就可以了。