PLS-00103:遇到符号" END"

时间:2014-11-28 22:06:04

标签: oracle plsql oracle-apex

我是Oracle PL / SQL的新手,当我尝试在Oracle APEX中运行此代码时,我在标题中提到错误,正好在 30 行。

以下是代码:

CREATE OR REPLACE PROCEDURE enter_student_grade 
    (p_num_grade IN class_assessments.numeric_grade%TYPE, 
     p_class_assessment_id IN class_assessments.class_assessment_id%TYPE,
     p_class_id IN class_assessments.class_id%TYPE,
     p_stu_id IN class_assessments.stu_id%TYPE, 
     p_assessment_id class_assessments.assessment_id%TYPE,
     p_date_turned_in IN DATE := SYSDATE) IS

v_max_id class_assessments.class_assessment_id%TYPE := 0;
v_max_attempts NUMBER(1,0):= 0;
BEGIN


    SELECT max(class_assessment_id)+1 INTO v_max_id
    FROM class_assessments;

    SELECT count(stu_id) INTO v_max_attempts FROM class_assessments WHERE stu_id = p_stu_id AND assessment_id = p_assessment_id

    IF  v_max_attempts < 3 THEN 

        INSERT INTO class_assessments
        (class_assessment_id,date_turned_id,numeric_grade,letter_grade,class_id,stu_id,assessment_id)
        VALUES
        (v_max_id,p_date_turned_in,p_num_grade,convert_grade(p_num_grade),p_class_id,p_stu_id,p_assessment_id);
        commit;
    ELSE
        dbms_output.put_line('ERROR: Current student has reached maximum number of attempts for this assessment');
    END IF;

END enter_student_grade;

我不知道,这个错误的来源可能在哪里。 任何帮助表示赞赏。 感谢

1 个答案:

答案 0 :(得分:1)

第二个SELECT语句(IF之前)后缺少符号;