frm-40654 Record has been updated by another user.Re Query to see change [message #517990] |
Sat, 30 July 2011 14:00 |
|
goparaju
Messages: 54 Registered: June 2011
|
Member |
|
|
[MERGED by LF]
Hi Experts,
I am working on form 6i, database 9i.
I have a table(emp): empno, ename, job, created by, creation_date
My form :
windows: 1. main window 2. find window
Main Window: It contains data block(emp block) on table emp. Shows 'empno', 'ename', 'job', 'INSERT' button,and 'UPDATE' button.
Find Window: It contains 'empno', 'ename', 'job','created_by','creation_date', and 'FIND' button.
If i search through FIND window, it will fetch the data from 'EMP' table and shows in MAIN window, emp block.
FIND BUTTON: SELECT empno, ename, job
FROM emp
WHERE empno=:blockemp.empno
AND ename=:blockemp.ename
AND job=:blockemp.job
AND created_by=:blockemp.created_by
AND creation_date=:blockemp.creation_date
:GLOBAL.find:='fd';(I declared global variable in new form instance)
INSERT BUTTON: commit_form;
UPDATE_BUTTON:
IF :GLOBAL.find='fd' THEN --(this is to udpate emp table when search through FIND window)
update emp
set empno=:blockemp.empno
,ename=:blockemp.ename
,job=:blockemp.job
where empno=:blockemp.empno
COMMIT;
ELSE --This is if i query data (F11)
COMMIT_FORM;
END IF;
If i query data(F11) on block emp, i can update data any number of times, it's working fine.
But if i search through the FIND window, if i udpate a record, first time, it's updating; but second time if i try update the record,it's giving below error.
ERROR:frm-40654 Record has been updated by another user.Re Query to see change
I understand that it's locking the table if manually update it(when i search data through FIND window).
Could somebody help me how to solve my problem, or any other alternate to update data when i search through FIND window.
Kindly help.
[Updated on: Fri, 05 August 2011 13:43] by Moderator Report message to a moderator
|
|
|
|
|
|
frm-40654: record updated by another user, requery to see changes [message #518668 is a reply to message #517990] |
Fri, 05 August 2011 06:42 |
|
goparaju
Messages: 54 Registered: June 2011
|
Member |
|
|
Hi Experts,
I am working in form 6i, database 9i. I have multi record datablock(based on table emp).
datablock: check box, empno, ename, job, submit button.
I am inserting records which are checked and assigning value to emp through sequence.
pre-insert: if checkbox_checked('block.checkbox') then
if :block.emp is null
select sequence.nextval
into :block.empno
from dual;
end if;
end if;
on-insert: if checkbox_checked('block.checkbox') then
if :block.emp is not null
insert_record;
end if;
end if;
submit button: commit_form;
Let us say, i checked 2 records, i clicked submit button, it's inserting 2 records. But after that, if i want to insert some other records, let us say, if i checked one more record, if click submit button, it's giving below error.
ERROR:frm-40654: record updated by another user, requery to see changes
Could somebody help me, why it's giving this error. i want insert records after first time insertion.
Kindly help me.
|
|
|
|
|
Re: frm-40654: record updated by another user, requery to see changes [message #518982 is a reply to message #518758] |
Mon, 08 August 2011 11:07 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
That error only occurs on update not insert. So forms thinks some of the records need updating.
That error also only occurs when data in the record in the DB differs from what forms thinks should be there.
So you need to debug your form to work out:
a) which records forms is trying to update - check record,block and form status.
b) which column values for those records differ on the DB to what is in the form.
|
|
|