Home » Developer & Programmer » Forms » saving certain records
saving certain records [message #233857] Fri, 27 April 2007 15:22 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Please Help. I have a question. I have a datablock that creates over 50 records and that displays them in a form, if a user changes a few of the records , how can i only save those records in the table instead of all records displayed?? Right now it saves all records but I only want to save to the table the 2-3 records a user changes.
Any help is appreciated
Re: saving certain records [message #233862 is a reply to message #233857] Fri, 27 April 2007 15:38 Go to previous messageGo to next message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
I presume you are speaking about an Oracle Forms application. Here is how I understand things:

oracle forms only updates rows that it thinks has changed. Rows in a block that are not modified are not updated on the database because no update event takes place for these rows.

so... if your form is updating a row, it thinks the row has been modified, and it is always right.

If you are certain that the user has not updated any fields on a row that is being updated anyway, then your form is modifying base table fields silently.

maybe you are setting some default values?

In any event, find where it is your form is modifying fields on records and then change the form behaviour if you can.
Re: saving certain records [message #234442 is a reply to message #233862] Tue, 01 May 2007 10:46 Go to previous messageGo to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

the first thing I am doing is a search for all task in one project I created a cursor (that pulls these tasks from another table and dumps them in my new table) that is called in a loop, each record is now displayed (about 100 in the new table) Now I want the user to go through the records and update certain records and save only those updated records but when hit save the form saves all 100 records to the new table what should I do , yes this is forms6i

[Updated on: Tue, 01 May 2007 10:49]

Report message to a moderator

Re: saving certain records [message #234456 is a reply to message #234442] Tue, 01 May 2007 12:02 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is how I understood your problem (which doesn't have to mean that I'm right): you fill a database block, do something with those records, press "Save" and wonder how come that all records got saved? Well, if you put them in there, why do you expect only some of them to be saved?

One way would be fetching records from the "original" table into a database block (created upon the "original" table), creating additional item (visible or not, let's say of a NUMBER datatype), setting it to 1 if the record has been changed. Then, in a KEY-COMMIT trigger, move into your target table only those records that have 1 in our "flag" item.
Previous Topic: Do i need to learn java for developing Forms 10G and Reports 10G
Next Topic: Validation of multirecord block
Goto Forum:
  


Current Time: Thu Feb 13 01:07:33 CST 2025