Home » Developer & Programmer » Forms » How to get values from DB before update (Oracle Forms 6i and above...)
How to get values from DB before update [message #299250] Mon, 11 February 2008 00:51 Go to next message
oralover
Messages: 97
Registered: January 2005
Member
Hi All Gurus!

I want to know about if I want to store previous values of a table row before updating through Forms, like in Database Trigger where we are referencing old values as :old.etc to get Values Before Update, how I can achieve this in Oracle Forms 6i or above versions.

for example: I made a form Employee to manipulate data by a user, if user update a record I want to store previous values before Commit in trigger Pre-Update with some additional informations. I do not want to use a Trigger on that Table.

thanks for the help.
Re: How to get values from DB before update [message #299253 is a reply to message #299250] Mon, 11 February 2008 00:58 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
There is 'get_item_property(database_value)'. However, I would strongly recommend using a database trigger.

David
Re: How to get values from DB before update [message #299254 is a reply to message #299250] Mon, 11 February 2008 00:58 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
You can use the PRE-UPDATE triggers for this. PRE-UPDATE triggers fires for each update on the form. In the trigger use a INSERT SELECT FROM YOUR_TABLE WHERE UNIQUE_COL = FORM.VALUE.

Regards,
Azam Khan
Re: How to get values from DB before update [message #299257 is a reply to message #299250] Mon, 11 February 2008 01:02 Go to previous messageGo to next message
oralover
Messages: 97
Registered: January 2005
Member
Thanks very much for both of you friends... Smile
much appreciable within no time response... Smile
Re: How to get values from DB before update [message #480366 is a reply to message #299257] Fri, 22 October 2010 13:07 Go to previous messageGo to next message
balji_dxb
Messages: 37
Registered: October 2007
Member
i used GET_ITEM_PROPERTY('VEND_CODE',DATABASE_VALUE) in when-validate-item and when i try to type a value 'ABC' the value returns as 'ABC' instead of null(there is no record in the database). how do i resolve this.
Re: How to get values from DB before update [message #480372 is a reply to message #480366] Fri, 22 October 2010 14:30 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use system.record_status to check if it's a new record.
Previous Topic: 10g -form 6i (merged)
Next Topic: LINKING DIFFERENT FORMS
Goto Forum:
  


Current Time: Fri Sep 20 04:31:57 CDT 2024