异常 PL/SQL: ORA-00997: illegal use of LONG datatype
建表语句
CREATE TABLE "TEST"."studentScore" (
"studentName" VARCHAR2(255 BYTE) NULL,
"className" VARCHAR2(255 BYTE) NULL,
"score" LONG NULL
)
TABLESPACE USERS
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL ;
存储过程
CREATE OR REPLACE
PROCEDURE getPm(s_name IN VARCHAR2, s_class IN VARCHAR2, s_pm out number)
AS
score long:=0;
spm number:=0;
BEGIN
--获取该学生该课程成绩
select s."score" INTO score from "studentScore" s
where s."studentName"=s_name
and s."className"=s_class;
--获取比该学生成绩高的人数
select count(s."studentName") INTO spm from "studentScore" s
where s."score">=score
and s."className"=s_class;
--得到该学生的排名
s_pm:=spm+1;
EXCEPTION
when no_data_found THEN
dbms_output.put_line(s_name+'的'+s_class+'课成绩不存在!!!');
END;