Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Add an update button

963899Nov 29 2012 — edited Dec 3 2012
Hello everyone!

I am using Oracle Forms 6i and here is my problemm..

I am trying to add a button in my forms that will update records in my table.
For example I have one datacolumn "TYPE_OF...", in my forms I made an ListItem for this column where I choose the type.
I made a recordGroup to automaticaly populate this item and everything works just fine.

Now when I press this button of mine (I named it "Change") I want to update my record and save it with the different type that I choose after saving the record first and the previuos record with the "old" type must be erased (not to have both records afterwards).

I started like this:

1. Made an alert (named "SPR") that will ask me when I press the button if I am sure that I want to change that record.
2. Alert have two buttons "Yes" and "No"
3. When I click on "Yes" my record is updated else nothing happens

Here is the CODE that I wrote in WHEN-BUTTON-PRESSED trigger (It doesn't work, normally, because I am quite new in PL/SQL programming):
DECLARE
	a NUMBER;
BEGIN
	a := SHOW_ALERT('SPR');
  	  IF a = Alert_Button1 THEN
		UPDATE My_Table (in my case name of the table is DOKUMENTI_GLAVA_UV - it's in Slovenian and it means Documents_Head)
		SET TYPE_OF.. (my case VRSTE_TEMELJNICE - means type of journal) = :D.TYPE_OF..; (my case - D is name of the block)
  	  ELSE
  	  	RAISE FORM_TRIGGER_FAILURE;  	 		
  END IF;	 	 
END;
It gives me error and says that My_table must be declared.

All I want is the CODE for my trigger and some advice if I make something wrong or I am trying to do something that it can not be done that way.

Thank you!
This post has been answered by MLBrown on Nov 30 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2012
Added on Nov 29 2012
4 comments
2,158 views