Home » Developer & Programmer » Forms » Update multiple records in a form
Update multiple records in a form [message #203630] Wed, 15 November 2006 21:13 Go to next message
highvoltage
Messages: 12
Registered: October 2006
Location: Singapore
Junior Member

UPDATE STUDENT

SET Stud_gname =:ADDSTUDENT_BLOCK.Stud_gname
SET Stud_fname =:ADDSTUDENT_BLOCK.Stud_fname

Where Stud_id = :ADDSTUDENT_BLOCK.Stud_id;

Commit;

Guys anything wrong with the above statement to update multiple fields in a form.
Getting an error msg upon complie.

Please advice.
Re: Update multiple records in a form [message #203632 is a reply to message #203630] Wed, 15 November 2006 21:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search this forum for 'commit commit_form standard.commit'. Example http://www.orafaq.com/forum/m/202035/67467/?srch=commit+commit_form+standard.commit#msg_202035

David
Re: Update multiple records in a form [message #203634 is a reply to message #203630] Wed, 15 November 2006 22:07 Go to previous messageGo to next message
highvoltage
Messages: 12
Registered: October 2006
Location: Singapore
Junior Member
solved the issue by adding commit_form thanks man.
Re: Update multiple records in a form [message #203638 is a reply to message #203634] Wed, 15 November 2006 22:25 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No - you really need to use 'standard.commit' because the 'update' statement is invisible to the Form. Read the threads, its all there.

David
Re: Update multiple records in a form [message #203697 is a reply to message #203630] Thu, 16 November 2006 01:28 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
highvoltage wrote on Thu, 16 November 2006 04:13

UPDATE STUDENT
SET Stud_gname =:ADDSTUDENT_BLOCK.Stud_gname
SET Stud_fname =:ADDSTUDENT_BLOCK.Stud_fname
Where Stud_id = :ADDSTUDENT_BLOCK.Stud_id;

Commit;

Guys anything wrong with the above statement to update multiple fields in a form.
Getting an error msg upon complie.

To me, it seems that COMMIT / COMMIT_FORM / STANDARD.COMMIT have absolutely nothing to do with your words. OK, David is right (I've never seen him being wrong Smile) about commiting issue, but you didn't actually try what David told you but (politely) answered that this solved the problem.

What certainly is wrong is UPDATE statement syntax - this trigger won't compile because you didn't write it correctly.

In order to make it work, rewrite it to look like this:
UPDATE student SET 
   Stud_gname = :addstudent_block.Stud_gname,
   Stud_fname = :addstudent_block.Stud_fname
WHERE Stud_id = :addstudent_block.Stud_id;

Now recompile it and see will it work.
Previous Topic: setting item property to <Unspecified>
Next Topic: How to Put value for query in Display Item Forms 6i
Goto Forum:
  


Current Time: Fri Sep 20 12:29:36 CDT 2024