Home » Developer & Programmer » Forms » updates
updates [message #116325] Tue, 19 April 2005 08:23 Go to next message
jonmich005
Messages: 53
Registered: April 2005
Member
I have a Data block and it's property of 'Number of records displayed ' stand s on 15.

Now if I want to update it, all the 15 records are update.
Not only the one I adjusted.

How can I resolve this problem?
this is my update-query:

update lds_tl_grid
set tl_grid_activity = :lds_tl_grid.tl_grid_activity
,tl_grid_int_1 = :lds_tl_grid.tl_grid_int_1
,tl_grid_int_2 = :lds_tl_grid.tl_grid_int_2
,tl_grid_int_3 = :lds_tl_grid.tl_grid_int_3
where tl_grid_veh_id = :lds_vehicle.veh_id;
commit;

All my 4 records are updated if I only adjust int_1.

How can I make this work?
Re: updates [message #116415 is a reply to message #116325] Tue, 19 April 2005 19:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Go to http://www.oracle.com/technology/documentation/forms.html. Find 'Guidelines for Building Applications'. Download it and read it!

If you base a block on a table you do not need to 'manually' update the entries.

I think you are over programing your form. Let Oracle Forms do the work for you. Keep it simple, clean, and clear.
Re: updates [message #116457 is a reply to message #116325] Wed, 20 April 2005 03:44 Go to previous messageGo to next message
jonmich005
Messages: 53
Registered: April 2005
Member
I have to update my form when I click on a button, so I have to write a trigger.

I have a form with 3 data blocks from 3 tables.
But when I click on the button, I get the message that the unique constraint is violated. But it's violated from a data block on my form BUT that is not in my update-statement, so a table that I not want to update.

Can you explain me this?
Re: updates [message #116462 is a reply to message #116325] Wed, 20 April 2005 03:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Yes, but the trigger may contain code as simple as:
begin
  commit_form;
end;

Try that and see how it goes. You may have to place a 'post' command in a trigger that fires each time you move out of a record so that subsequent 'select' statements can see your new data. Remember that 'post' is a restricted operation. Also use a get_record_property to see whether the record status has changed as you shouldn't do unnecessary 'post's.
Re: updates [message #116467 is a reply to message #116462] Wed, 20 April 2005 04:20 Go to previous messageGo to next message
jonmich005
Messages: 53
Registered: April 2005
Member
I still get that error, but that means that my primary key will be duplicated if I'm not mistaking.
But I don't change my primary key, why do I get that message then?
I only need to update the fields that I've changed, not the field that weren't changed.

How does this come?
Re: updates [message #116602 is a reply to message #116325] Wed, 20 April 2005 19:47 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I believe that the trigger that is giving you your primary key sequence number is firing for every record every time. Search the 'fmb' for 'nextval' and put it in a place where it is only actioned when the primary key field is NULL and the record status is NEW.
Previous Topic: truncate + forms_ddl
Next Topic: help me
Goto Forum:
  


Current Time: Sat Feb 08 00:45:38 CST 2025