set serveroutput on --打开服务器端的输出功能
create or replace procedure TEST(
cur_date IN date
)
as
v_productid wap_d_download.productid%TYPE; --产品ID
v_contentid wap_d_download.contentid%TYPE; --内容ID--从download表中查询
CURSOR cps_cursor is
select t.productid, t.contentid from wap_d_download t where t.id = '17826198';
row_download cps_cursor%ROWTYPE;
BEGIN
open cps_cursor;
LOOP
fetch cps_cursor into row_download;
exit when cps_cursor%NOTFOUND;
v_productid := row_download.productid; --将row_download中的productId字段值赋值给v_productid
v_contentid := row_download.contentid; --将row_download中的contentid字段值赋值给v_contentid
dbms_output.put_line('产品ID:'||row_download.productid);
--入库
insert into wap_d_cp_gain_test(pid,contentid) values (v_productid,v_contentid);
commit; --提交事务
END LOOP;
EXCEPTION when others then --异常处理
dbms_output.put_line(sqlcode);
dbms_output.put_line(sqlerrm);
close cps_cursor;
END TEST;
请问各位达人,我刚写的这个Procedure执行时没有报错,但为什么dbms_output不能输出信息
而且还不能按要求向库中填入数据呢?????谢谢
create or replace procedure TEST(
cur_date IN date
)
as
v_productid wap_d_download.productid%TYPE; --产品ID
v_contentid wap_d_download.contentid%TYPE; --内容ID--从download表中查询
CURSOR cps_cursor is
select t.productid, t.contentid from wap_d_download t where t.id = '17826198';
row_download cps_cursor%ROWTYPE;
BEGIN
open cps_cursor;
LOOP
fetch cps_cursor into row_download;
exit when cps_cursor%NOTFOUND;
v_productid := row_download.productid; --将row_download中的productId字段值赋值给v_productid
v_contentid := row_download.contentid; --将row_download中的contentid字段值赋值给v_contentid
dbms_output.put_line('产品ID:'||row_download.productid);
--入库
insert into wap_d_cp_gain_test(pid,contentid) values (v_productid,v_contentid);
commit; --提交事务
END LOOP;
EXCEPTION when others then --异常处理
dbms_output.put_line(sqlcode);
dbms_output.put_line(sqlerrm);
close cps_cursor;
END TEST;
请问各位达人,我刚写的这个Procedure执行时没有报错,但为什么dbms_output不能输出信息
而且还不能按要求向库中填入数据呢?????谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货