Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a view problem
Message
From
01/09/2003 08:47:53
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
30/08/2003 20:21:55
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00824703
Message ID:
00825031
Views:
25
As Caroline points out, you can
REPLACE area with calcarea()
However, since you said the trigger is already in place, you don't need to do a replace or a tableupdate. I assume you have a textbox showing the area on the screen. Just update the value of that textbox with the result of the calculation whenever the values of length and width change.



>Hi Mike,
>
>I like the sounds of your second suggestion, but, I'm not exactly sure what you mean.
>
>I already have the area calculated via a stored procedure in my DBC (I'm not sure that I had made that clear in my original message). It is called in a trigger set for updating the length and the width fields.
>
>How do I call that stored procedure from the form? Could you kindly elaborate? Treat me like a newbie to triggers and stored procedures because I really am one:)
>
>Thanks,
>
>Mike
>
>
>>The tableupdate sends the data from the view to the tables. This update to the tables fires the triggers, which updates area in the tables. The view is unaffected. You could ...
>>
>>1) requery the view to get the new area, which could be a performance problem.
>>
>>2) make the area calculation a stored procedure, called from the trigger and from the form.
>>
>>>I have a VFP8 form with a local view in its dataenvironment. On the form, I put two spinners, one for a length value and another for a width value. A textbox is also on the form that show the product of the former (ie. area).
>>>
>>>My VFP database container has a field update trigger that calls a stored procedure to do the area calculation when the length and width fields change. I've verified that this all works fine when I browse the table and edit the length and/or width fields and the area fields change accordingly.
>>>
>>>My problem is that when I use the view based on this table, and make changes to the length or width values, the area value never refreshes to show the correct calculated value. I issued a TABLEUPDATE on the view and expected it to update the area. It doesnt. The underlying table does in fact get updated with the correct values, however, the view does not.
>>>
>>>I checked the methods and properties of the dataenvironment and could find anything that could help.
>>>
>>>My question is, how do I get the view to update the calculated values (the stuff done in the stored procedure) so that it appears correctly on my form?
>>>
>>>Any suggestions and/or comments are greatly appreciated.
>>>
>>>TIA
>>>
>>>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform