Error FRM-40735 , ORA-01438
RakinJun 24 2007 — edited Jun 25 2007Hi,
In my form, for the Master-Details Data Block, the DML source is Procedure,
For eg, the DetailsBlock name is "Files", and given below is the procedure to update that block. I have two doubts regarding to it,
1. When user click Save button , i want to execute this procedure for all the records, now it is updating only one row, because of dmlset(1) (how should i do loop, I am new baby).
2. Insert into TableA query is not executing, i am getting the error ORA -01438
Scenario is :
The datas are loaded into block from TableA and TableB.If the value of the column VALIDREJECTION is "InValid" then that row shoube be updated in the TableA, if it is not in TableA, then it should be inserted to TableA. That is TableB contains all records(both Valid & InValid) , but TableA contains only records with VALIDREJECTION ='InValid"
My Procedure is :
procedure filesUpdate(dmlset in out disputeFiles_tab) is
cursor c_files is
select FILEID
from TableA
where FILEID=dmlset(1).FILEID;
tempout TableA.fileid%type;
begin
if dmlset(1).VALIDREJECTION='Valid' then
DELETE FROM TABLEA WHERE FILEID=dmlset(1).FILEID;
else
--if Valid changed to InValid and updated, then it should be inserted
open c_files;
fetch c_files into tempout;
IF c_files%NOTFOUND then
insert into TableA(FILEID,VALIDREJECTION,USERID)
values(dmlset(1).FILEID,dmlset(1).VALIDREJECTION,
dmlset(1).USERID);
ELSE
update TableA
set FILEID=dmlset(1).FILEID,
VALIDREJECTION=dmlset(1).VALIDREJECTION,
USERID=dmlset(1).USERID,
where FILEID=dmlset(1).FILEID;
END IF;
close c_files;
end if;
end;
Thanks in Advance ,
bye bye