塊下面的SELECT語句是我的PL/SQL塊:中如果甲骨文的PL/SQL
DROP TYPE t_tf_tab;
DROP TYPE t_tf_row;
CREATE TYPE t_tf_row AS OBJECT (
zipzone_id NUMBER,
beginzipcode NUMBER,
endzipcode NUMBER,
cu_rate number,
st_rate number,
su_rate number
);
CREATE TYPE t_tf_tab IS TABLE OF t_tf_row;
----------------------------------------------------------------------------------------------
create or replace
FUNCTION get_tab_ptf (p_rows IN NUMBER) RETURN t_tf_tab PIPELINED IS
zip_id1 number;
zip_id2 number;
begin_zip number;
end_zip number;
rowcount number;
rec t_tf_row;
BEGIN
select count(*) into rowcount from GSW_ZIP_ZONES;
select min(ZIPZONE_ID) into zip_id1 from GSW_ZIP_ZONES;
zip_id2 :=zip_id1 +1;
select ENDZIPCODE into end_zip from GSW_ZIP_ZONES where ZIPZONE_ID=zip_id1;
select BEGINZIPCODE into begin_zip from GSW_ZIP_ZONES where ZIPZONE_ID=zip_id2;
FOR counter in 1..rowcount
LOOP
if((begin_zip-end_zip)>1) THEN
SELECT z.ZIPZONE_ID, z.BEGINZIPCODE, z.ENDZIPCODE, z.TAXING_CODE_ID, g.su_rate
into rec
from SBXEXT.GSW_ZIP_ZONES z
join gsw_geocodes g on z.taxing_code_id= g.taxing_code_id where ZIPZONE_ID in (zip_id1,zip_id2);
PIPE ROW (rec);
end if;
zip_id1 :=zip_id1 + 1;
zip_id2 :=zip_id2 + 1;
END LOOP;
RETURN;
END;
我越來越如果語句後錯誤。錯誤在Select語句中,它會告訴select語句將被忽略。我不知道如何在If塊中使用Select語句。請幫忙。
分享我們的錯誤信息,請! – 2014-10-03 20:33:56