2
我是PL/SQL的新手,并尝试使用CURSOR。我希望验证插入过程,所以我编写了另一个过程来这样做。Pl/SQL过程CURSOR循环
CREATE OR REPLACE PROCEDURE verify_insert
IS
CURSOR map_cur IS
SELECT Page_ID_NBR, Page_Type, Page_Dcpn FROM SSC_Page_Map;
map_rec map_cur%ROWTYPE;
BEGIN
OPEN map_cur;
FOR map_rec in map_cur
LOOP
DBMS_OUTPUT.PUT_LINE('ID: ' || map_cur.Page_ID_NBR || ' ' || 'Type' || map_cur.Page_Type || ' ' || 'Description' || map_cur.Page_Dcpn);
END LOOP;
CLOSE map_cur;
END;
SHOW ERRORS PROCEDURE verify_insert;
我收到以下消息
[Warning] ORA-24344: success with compilation error
19/44 PLS-00225: subprogram or cursor 'MAP_CUR' reference is out of scope
19/5 PL/SQL: Statement ignored
(47: 0): Warning: compiled but with compilation errors
我也看到
Errors for PROCEDURE VERIFY_INSERT
LINE/COL ERROR
-------- -----------------------------------------------------------------
19/44 PLS-00225: subprogram or cursor 'MAP_CUR' reference is out of sco
19/5 PL/SQL: Statement ignored
正如我写的,我的新尝试PL/SQL的知识从Oracle PL/SQL Programming (Feuerstein)
凑齐和互联网。一起来,但没有我想要的那么快。
谢谢。我只是从网上复制坏榜样而得到的。你能指点我一个伟大的网站,我可以迅速增加我的知识,并避免狩猎和啄食方法,它有'陷阱?谢谢。 – Mushy