调整下顺序就好了,呵呵
create or replace procedure AA_mytest(P1 in varchar2, P2 out varchar2) is
cellcode varchar2(30);
taskno varchar2(4);
CURSOR CURSOR_TEMP(cp1 VARCHAR2) IS
select cell_code from cmd_cell t where t.product_code=cp1;
begin
open CURSOR_TEMP(P1);
loop
FETCH CURSOR_TEMP INTO cellcode;
dbms_output.put_line(cellcode);
select task_no into taskno from wcs_task t where t.cell_code=cellcode;
IF CURSOR_TEMP%NOTFOUND THEN
EXIT;
END IF;
end loop;
end AA_mytest;
create or replace procedure AA_mytest(P1 in varchar2, P2 out varchar2) is
cellcode varchar2(30);
taskno varchar2(4);
CURSOR CURSOR_TEMP(cp1 VARCHAR2) IS
select cell_code from cmd_cell t where t.product_code=cp1;
begin
open CURSOR_TEMP(P1);
loop
FETCH CURSOR_TEMP INTO cellcode;
dbms_output.put_line(cellcode);
select task_no into taskno from wcs_task t where t.cell_code=cellcode;
IF CURSOR_TEMP%NOTFOUND THEN
EXIT;
END IF;
end loop;
end AA_mytest;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货