ora 1008에러가 나는데 이유를 모르겠습니다.
---------------------------------------------------------------------------------------
procedure p01(
p_i_sundxc in varchar2,
p_i_ggdsxc in varchar2,
p_i_cgijxd in varchar2,
p_CGFIMC out char_,
rv out number
) as
i number(8);
type type_cur is ref cursor;
rec type_cur;
v_query varchar2(4000);
begin
p_CGFIMC := char_();
begin
i := 1;
v_query :=
'select' ||
' ''34100288_'' || substr(:1,4,1) || ''H'' || :2 || ''_'' || substr(:3,3,6) || ''_'' ||' ||
' decode( length(nvl(max(substr(RECEIPT_NAME,21,3)),0) + 1),' ||
' ''1'', ''0'' || to_char(nvl(max(substr(RECEIPT_NAME,21,3)),0) + 1),' ||
' to_char(nvl(max( to_number(substr(RECEIPT_NAME,21,3)) ),0) + 1) ) cgfimc' ||
' from table01' ||
' where substr(RECEIPT_NAME,14,6) = substr(:3,3,6)' ||
' and substr(RECEIPT_NAME,10,1) = substr(:1,4,1)' ||
' and substr(RECEIPT_NAME,12,1) = :2' ||
'';
OPEN rec FOR v_query USING p_i_sundxc, p_i_ggdsxc, p_i_cgijxd;
loop
p_CGFIMC.extend(1);
fetch rec into
p_CGFIMC(i);
EXIT WHEN rec%NOTFOUND;
i := i + 1;
end loop;
rv := i - 1;
EXCEPTION
when NO_DATA_FOUND then
rv := i - 1;
return;
WHEN OTHERS THEN
rv := sqlcode;
return;
end;
end;
|