Home » Developer & Programmer » Forms » How to get Forms to perform UPDATE not INSERT (FORMS 6i on Linux)
How to get Forms to perform UPDATE not INSERT [message #327782] Tue, 17 June 2008 10:04 Go to next message
wrwelden
Messages: 7
Registered: November 2004
Junior Member

I have developed a form with one data block and one control block. The data block has a non-database item that needs to allow for input. This 'amount' is used to adjust other database items in the block.The form opens in insert mode and an execute query is performed to populate the block. This form is to be used to perform updates only. Various edits are performed, but , on save the default functionality attempts to insert rows instead of doing an update. Why?

And how do i get the form to perform an update?
Re: How to get Forms to perform UPDATE not INSERT [message #327816 is a reply to message #327782] Tue, 17 June 2008 15:18 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
on save the default functionality attempts to insert rows instead of doing an update
I wouldn't agree. Forms default behaviour is to UPDATE a record when you update it. Therefore, there *must* be code which is trying to perform INSERT INTO command.

Or, you aren't updating a record (although you think you are), but inserting it.
Re: How to get Forms to perform UPDATE not INSERT [message #327866 is a reply to message #327782] Wed, 18 June 2008 04:14 Go to previous messageGo to next message
Martin Eysackers
Messages: 80
Registered: October 2005
Location: Belgium
Member
since your form is to be used to update only
why not disable insert_allowed on the block level

in your form this should now cause an error (since it seems to be trying to insert somehow) at runtime which might help you in finding the problem
Re: How to get Forms to perform UPDATE not INSERT [message #328940 is a reply to message #327866] Mon, 23 June 2008 08:15 Go to previous messageGo to next message
wrwelden
Messages: 7
Registered: November 2004
Junior Member

When I disable insert_allowed at the block level, an item I have added to the data block that must be available for user input is greyed-out. It is a non-database item that is to be used to make adjustments to a database column on the current record after edits.
Re: How to get Forms to perform UPDATE not INSERT [message #328960 is a reply to message #328940] Mon, 23 June 2008 09:41 Go to previous messageGo to next message
wrwelden
Messages: 7
Registered: November 2004
Junior Member

The solution used for this odd form is so obvious in retrospect. Because of the way the block was populated, using a select statement after the second of two LOV's fired, an ON_INSERT trigger was used to do the update.
Re: How to get Forms to perform UPDATE not INSERT [message #337118 is a reply to message #328960] Wed, 30 July 2008 00:26 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Stop with the re-inventing of the wheel. This is not VB!! Use the default behaviour of Oracle Forms and not your own select loops.

David
Previous Topic: how to insert a character value with out numbers (merged)
Next Topic: from access to oracle
Goto Forum:
  


Current Time: Thu Feb 06 23:49:44 CST 2025