日期:2014-05-17  浏览次数:20755 次

存储过程提问,为什么在测试的时候我输入值的时候新表没有变化?
过程代码如下:

create or replace procedure test_insert (ls_id in number)
as
id varchar2(10);
ic varchar2(10);
ie varchar2(40);
ir varchar2(10);
it number(12,2);
begin
declare cursor test_insert1 is 
select c_sku_id ,c_kind_id ,c_goods_name ,c_supply_id,n_standard_price 
into id,ic,ie,ir,it 
from infor_sku 
where it >= ls_id; 
begin 
for test2 in test_insert1 loop 
insert into test (sku_id,kind_id,goods_name,supply_id,standard_price)values (id,ic,ie,ir,it);
end loop;
end;
end;

小弟着急,在线等

------解决方案--------------------
你这个存储过程貌似语法都有问题~~
SQL code

create or replace procedure test_insert (ls_id in number) 
as  
cursor test_insert1 is 
select c_sku_id ,c_kind_id ,c_goods_name ,c_supply_id,n_standard_price 
from infor_sku 
where it >= ls_id; 
begin 
for test2 in test_insert1  loop 
begin
insert into test (sku_id,kind_id,goods_name,supply_id,standard_price)values (test2.c_sku_id ,test2.c_kind_id ,test2.c_goods_name ,test2.c_supply_id,test2.n_standard_price );
commit;
end; 
end loop; 
end;

------解决方案--------------------
同意楼上
------解决方案--------------------
看下数据, 能不能找到为什么没有执行
我 忘了 close test_insert1;