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