Home » Developer & Programmer » Forms » How to capture item updation in database block???
How to capture item updation in database block??? [message #84066] Sat, 24 January 2004 00:02 Go to next message
Victoria
Messages: 152
Registered: July 2002
Senior Member
Hi,
I have one database block comprising of 15 columns in my form.I have one save button where i have written commit_form.
Now the problem is,
I need to insert a record into some other table if there is an updation to two specific fields in my database block.

Fo ex,
Table1 is having col1,col2,col3,col4,col5,col6.
Number of records shown are = 20(say).
So when i update 'col4' or 'col5' text items i need to insert a record into Table2.
Note that i have to insert only when there are changes in the values of 'col4' or 'col5'.
How to achieve this?
Thanks in Advance
~V~
Re: How to capture item updation in database block??? [message #84070 is a reply to message #84066] Sat, 24 January 2004 19:01 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
Fire an Insert statement in Post-Update trigger of your database block level.Hope this helps you.
Re: How to capture item updation in database block??? [message #84072 is a reply to message #84070] Sat, 24 January 2004 20:44 Go to previous messageGo to next message
Victoria
Messages: 152
Registered: July 2002
Senior Member
Hi,
Thank you sameer....But this will insert even when other fields are updated right....But i want to insert only when tow specific fileds(col4 or col5) are updated.....I hope you got my question....
Thanks
~V~
Re: How to capture item updation in database block? [message #84118 is a reply to message #84066] Fri, 30 January 2004 22:30 Go to previous messageGo to next message
Vamsi Mohan
Messages: 16
Registered: December 2003
Junior Member
add the triggers pre-text-item, post-text-item
for the columns whose updation should trigger an
insert into table2

pre-text-item
-------------
:global.old_col4_value := name_in(:system.trigger_item);

post-text-item
--------------
if name_in((:system.trigger_item) != :global.old_col4_value then

....

insert into table2
values( val1,val2..)

...

end if;

The combination of these two triggers provides an indication that the value has been changed.
Re: How to capture item updation in database block? [message #84182 is a reply to message #84072] Tue, 10 February 2004 18:15 Go to previous message
prashant
Messages: 122
Registered: September 2000
Senior Member
if i were u i won't do it from the form.
i'll probably use a database trigger to do. Its fast and accurate.
thanks
Prashant
Previous Topic: how to bring excel file into forms
Next Topic: autonumber on char datatype.
Goto Forum:
  


Current Time: Thu Mar 28 21:38:14 CDT 2024