Re: Forms 4.5, Personal Oracle7 & FRM-40654

From: Thomas B. Cox <tcox_at_netcom.com>
Date: 1995/04/27
Message-ID: <tcoxD7puyw.Cnr_at_netcom.com>#1/1


Lee Mayhew <lmayhew_at_ionet.net> wrote:
> jordan_at_pt5026.pto.ford.com says...
>>Lee asks:
 

>>>I am devloping an application using Forms 4.5 and Personal Oracle7
>>>that has one central control block, that has the insert, update, delete
>>>properties turned off. This block is just to basically for querying
>>>data, although it is also used update, insert, or delete data for
>>>a corresponding table in the database.

If the block property "base table" is filled in, then it's still a base table block, not a control block.

>>>It does this by calling another
>>>block which will pops up a window where the user can change data in
>>>a block that doesnot correspond with any table. Once the user is
>>>finished editing data by pushing the "OK" button, the necessary update,
>>>or insert property is turned on and data is passed back to the central
>>>block where the data is commited to the database for the corresponding
>>>table.

Are you using SQL or PL/SQL statements to directly update the tables, or are you just updating the contents of the base table block's fields?

If you hit the DB directly, then the first (base table) block is out of sync with the table.

If you update the base table block's fields, then you can use regular Forms processing to pass the changes to the table and commit them. Unless having UPDATE turned off gives you trouble...

>>>This works fine for the first update or insert. But when I try to
 update
>>>a record for a second time I get a "FRM-40654: Record has changed.
>>>Re-query to see changes.". The cause of error in the book says another
>>>user has changed the row. I don't understand this since I am runing
>>>Personal Oracle.

Try saving the Primary Key value into a variable and do a re-query of data after you've committed changes.

>>The other user is yourself. Whenever you have two blocks based on the
>>same table you may run into this problem. When you query rows into the
>>first block, then do the same with the second block you have "two"
 users.
>>If you modify a row in one block and commit, the other block will still
>>have the old data. When you try to modify this row, SQL*Forms detects
>>that it no longer has the current values and lets you know that
>>"somoneone else" changed it. Requery the other block to get around the
>>problem or try another approach completely.
 

>>David Jordan
 

>Dave,
 

>I can see what you are saying happening if I were using two blocks that
>corresponded to the same table.... but the block I am using to edit the
>data is a "control block" and does not correspond with any table in the
>database, therefore I wouldn't think it should effect the status of the
>block I am using to update the table.
 

>Lee

See above comments. Good luck.

 -Tom

-- 
Thomas B. Cox   tcox_at_netcom.com
Author of _Oracle Workgroup Server Handbook_, ISBN 0-07-881186-4
   See:   http://www.oracle.com/info/magazine/orapress.html
Received on Thu Apr 27 1995 - 00:00:00 CEST

Original text of this message