当前位置: 首页 > 知识库问答 >
问题:

我得到这些错误,不明白如何修复

养学
2023-03-14
  • 错误(25,1):PLS-00103:遇到符号“EXEC”

放下桌上的学生;提交;

 CREATE TABLE Student(
    studentNumber INT NOT NULL,
    studentName VARCHAR2(20) NOT NUll,
    gender CHAR(1) NOT NULL,
    highSchoolAvg INT NOT NULL,
    scholarship INT DEFAULT 0,
    CONSTRAINT "student_gender" CHECK (gender IN ('M', 'F')),
    CONSTRAINT "student_highSchoolAvg" CHECK (highSchoolAvg BETWEEN 0 AND       100)
);

CREATE OR REPLACE PROCEDURE AcceptStudent(
    studentNumberPR INT,
    studentNamePR VARCHAR2,
    genderPR CHAR,  
    highSchoolAvgPR INT)
IS
    ScholarshipPr INT;
BEGIN
    ScholarshipPR := 0;

    IF highSchoolAvgPR >= 90 and highSchoolAvgPR <=100 THEN
        ScholarshipPR := 1500;

    ELSIF highSchoolAvgPR >= 85 and highSchoolAvgPR < 90 THEN
        ScholarshipPR := 1000;

    ELSE
       raise_application_error(-20201, 'Invalid highSchool average');
    END IF;

    INSERT INTO Student (studentNumber, studentName, gender,     highSchoolAvg, scholarship) 
        VALUES (studentNumberPR, studentNamePR, genderPR,     highSchoolAvgPR, ScholarshipPr);
END;

exec ACCEPTSTUDENT (1, 'Ashley', 'F', 87);
exec ACCEPTSTUDENT (2, 'Will', 'M', 76);
exec ACCEPTSTUDENT (3, 'David', 'M', 94);
--Holly should be the only error--
exec ACCEPTSTUDENT (4, 'Holly', 'F', 103);
select * from student;

共有1个答案

颛孙飞
2023-03-14

您是否试图执行脚本中的所有内容?您在过程之后的单独一行中缺少斜杠/本身。

 类似资料: