Home > Database > Mysql Tutorial > ORA-00947: Not enough values 没有足够的值

ORA-00947: Not enough values 没有足够的值

WBOY
Release: 2016-06-07 17:27:01
Original
2943 people have browsed it

这里select classno 班级, avg(score) 平均分 into avgScore就出现了问题,改为 create or replace procedure myproc(classno1 i

执行insert的时候出现这个错误。
 
insert into 表1 values (123,2423,12);
 
表1的结构有4个column,显然插入的值只有三个,因此才会出现这个问题。
 
再加个column 的值执行后,ok。
 
倘若只想插入三个数值的话:
 
insert into 表1(a,b,c) values (123,2423,12);
 
用这个语句就可以了。
 
create or replace procedure myproc( cname1 in varchar2, semester1 in varchar2, avgScore out number)
as
begin
select classno 班级, avg(score) 平均分 into avgScore
from student s, course c, student_course_teacher sct
where s.classno=classno1
and c.cname = cname1
and sct.semester = semester1
and s.sno = sct.sno
and c.cno = sct.cno
group by classno;
end;
 
这里select classno 班级, avg(score) 平均分 into avgScore就出现了问题,改为 create or replace procedure myproc(classno1 in varchar2, cname1 in varchar2, semester1 in varchar2, avgScore out number)
 
select avg(score) 平均分 into avgScore 问题得以解决,要注意更新的值的个数与attribute的个数 保持一致。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template