使用编译错误创建的过程 - 但无法找到错误

时间:2015-05-11 19:31:29

标签: sql oracle procedure

我有一个程序,但我无法找到错误的位置:

CREATE OR REPLACE PROCEDURE ADD_GRADE (
    STUDEN_ID IN VARCHAR2(6),
    SEC_ID IN NUMBER(6),
    NEW_GRADE IN CHAR (1)
) 
AS
BEGIN 
    UPDATE ENROLLMENT 
    SET grade = NEW_GRADE 
    WHERE s_id = STUDEN_ID AND c_sec_id = SEC_ID;
END;
/

2 个答案:

答案 0 :(得分:3)

运行此查询..

 select * from user_errors where name ='ADD_GRADE' 

你会有错误

答案 1 :(得分:3)

尊重@MarkLeiber发现错误......

请改为尝试:

CREATE  OR REPLACE  PROCEDURE ADD_GRADE (
    STUDEN_ID IN VARCHAR2,
    SEC_ID IN NUMBER,
    NEW_GRADE IN CHAR
) 
AS
BEGIN 
    UPDATE ENROLLMENT 
        SET grade = NEW_GRADE WHERE s_id = STUDEN_ID AND c_sec_id = SEC_ID;
END;
/