Home » Developer & Programmer » Forms » frm-40654 Record has been updated by another user.Re Query to see change
frm-40654 Record has been updated by another user.Re Query to see change [message #517990] Sat, 30 July 2011 14:00 Go to next message
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

Re: frm-40654 Record has been updated by another user.Re Query to see change [message #517993 is a reply to message #517990] Sat, 30 July 2011 15:41 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
You have a database datablock that you populate both programatically and through execute query?
Re: frm-40654 Record has been updated by another user.Re Query to see change [message #518010 is a reply to message #517993] Sun, 31 July 2011 05:43 Go to previous messageGo to next message
goparaju
Messages: 54
Registered: June 2011
Member
Hi,

Yes,both ways,programatically through FIND window and execute query through F11.

Kindly help me what could be the possible solution.

Thanks.
Re: frm-40654 Record has been updated by another user.Re Query to see change [message #518026 is a reply to message #518010] Sun, 31 July 2011 17:51 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Stop doing that.
If you want that level of programatic control on a database datablock, base it on a procedure.
There's no way mixing approaches like that is going to work, even if you fix this bug you'll just encounter others.
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 Go to previous messageGo to next message
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 #518730 is a reply to message #518668] Fri, 05 August 2011 13:46 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Re-read what Cookiemonster said several days ago.
Re: frm-40654: record updated by another user, requery to see changes [message #518758 is a reply to message #518730] Sat, 06 August 2011 04:58 Go to previous messageGo to next message
goparaju
Messages: 54
Registered: June 2011
Member
Hi,

Thanks for your reply. I am not doing anything programmatic to insert data. I am just assigning empno through sequence. Could you help me how to insert data after first insertion also.

Kindly help.

Thanks.
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 Go to previous message
cookiemonster
Messages: 13937
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.
Previous Topic: want to check for checkbox status with one more corresponding value
Next Topic: Need some help with a screen
Goto Forum:
  


Current Time: Tue Sep 10 02:12:57 CDT 2024