Home » Developer & Programmer » Forms » Create Form using View
icon1.gif  Create Form using View [message #179427] Tue, 27 June 2006 06:24 Go to next message
mehulmb
Messages: 25
Registered: May 2006
Location: Pune
Junior Member


I have create one view and view related trigger. Then I make new form using view. When i add any new data and save it, it is display error : frm-40508 and cannot insert data..

what to do..? I am used Form 6i...and oracle 8i...

My view and trigger are below :


conn scott/tiger@starnet

=================================================================
create or replace view emp_dept as
select e.empno,
e.ename,
e.job,
d.deptno
from emp e, dept d
where e.deptno = d.deptno
and e.deptno = 10;


select * from emp_dept;

=================================================================
create or replace trigger emp_dept_trg_all instead of insert or delete or update on emp_dept
referencing new as new old as old
for each row
begin
if inserting then
insert into scott.emp
(
empno ,
ename ,
job ,
mgr ,
hiredate ,
sal ,
comm ,
deptno
)
values
(
:new.empno,
:new.ename,
:new.job,
NULL,
sysdate,
0,
0,
:new.deptno
);
elsif updating then
update scott.emp set
empno = :new.empno,
ename = :new.ename,
job = :new.job,
deptno = :new.deptno
where empno = :new.empno;

elsif deleting then
delete from scott.emp where empno = :old.empno;
end if;
end;
Re: Create Form using View [message #179535 is a reply to message #179427] Tue, 27 June 2006 20:21 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search this forum for 'updatable columns'.

David
Previous Topic: call_form question
Next Topic: DDE.request
Goto Forum:
  


Current Time: Fri Sep 20 09:25:10 CDT 2024