This error occurs when the insert statement is executed.
Insert into Table 1 values (123,2423, 12 );
The structure of Table 1 has four columns. Obviously, only three columns are inserted, so this problem occurs.
After the value of another column is executed, OK.
If you only want to insert three values:
Insert into table 1 (a, B, c) values (123,2423, 12 );
Use this statement.
Create or replace procedure myproc (cname1 in varchar2, semester1 in varchar2, avgScore out number)
As
Begin
Select classno class, avg (score) average 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;
Here, the select classno class, avg (score) average score into avgScore has a problem, changed to create or replace procedure myproc (classno1 in varchar2, cname1 in varchar2, semester1 in varchar2, avgScore out number)
The select avg (score) Average into avgScore problem can be solved. Note that the number of updated values is consistent with the number of attribute values.