
November 18th, 2003, 05:59 PM
|
|
Senior Member
|
|
Join Date: Sep 2003
Location: Canada
Posts: 305
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 10
|
|
|
I want to add a default employee in the each department if there is no employee in the department. I typed the following pl/sql behind the button and it works.
commit_form;
DECLARE
count integer;
BEGIN
SELECT count(*) INTO count FROM emp
WHERE deptno = :dept.deptno;
if count=0 then
insert into emp (empno,ename,sal,deptno)
values(9000,'Default',0,:dept.deptno));
end if;
END;
I dont know what is the problem in your form. can you please send me little bit more detail, like what is the relatioship beetween your table and how many constraints each table has?
Regards
|