Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Error while trying to INSERT RECORD -ORA-1400
hi guys,
Oracle 7.1 Pl/SQL 2.1
I have a PL/SQL block described below in which I defined a cursor and use a for loop to fetch record from the emp table. Every record has an empno which is the primary key NOT NULL. The table has all the records. I then wrote a procedure to add a bonus to each record in the emp table. When I execute the PL/SQL block I get an error
: ORA-01400 primary key or mandatory (NOT NULL) column is missing or NULL during insert
Could somebody help in pointing out my error or where I am actually wrong in my coding. I'm a newbie.
(empno_in emp.empno%type, bonus_in number)
begin
v_bonus := v_bonus + bonus_in;
insert into emp (comm)
values (v_bonus)
end;
declare
cursor emp_cur is
select empno, ename
from emp where deptno = 10 order by hiredate;
emp_rec emp_cur%rowtype;
Begin
for emp_rec in emp_cur
Loop
give_bonus(emp_rec.empno, 10000);
end loop;
commit;
end;
/
Received on Mon Jun 16 1997 - 00:00:00 CDT
![]() |
![]() |