2013-03-24 187 views
0
create or replace PROCEDURE check_stock_qty 
    BEGIN 
    FOR r IN 
    (SELECT P_ID FROM product WHERE PRODUCT.p_value < 50 
    ) 
    LOOP 
     apex_mail_p.mail 
     (
     '[email protected]', 
     '[email protected]', 
     'TEST', 
     '(r.P_ID)'); 
    END LOOP; 
    END; 
+2

呃,你的問題是什麼?我認爲oracle有一個「顯示錯誤」命令,你可以發出更多的細節。 – span 2013-03-24 03:13:58

回答

2

你錯過的程序名後ISAS創建過程:

create or replace PROCEDURE check_stock_qty IS 
... 
1

你錯過AS關鍵字

CREATE OR REPLACE PROCEDURE check_stock_qty 
AS 
BEGIN 
    FOR r IN (SELECT P_ID 
       FROM product 
       WHERE PRODUCT.p_value < 50) 
    LOOP 
     apex_mail_p.mail ('[email protected]', 
         '[email protected]', 
         'TEST', 
         '('|| r.P_ID ||')'); 
    END LOOP; 
END; 
+0

擊敗你5秒。 :p – 2013-03-24 03:16:04

3

要找到錯誤在你的對象上,試試

SELECT * FROM ALL_ERRORS WHERE NAME = 'CHECK_STOCK_QTY' 

分享和享受。