Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a view problem
Message
De
01/09/2003 22:11:11
Mike Sue-Ping
Cambridge, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00824703
Message ID:
00825157
Vues:
24
Hi Caroline,

Thanks for trying to assist me. Perhaps my problems will be better illustrated if you could please see my reply to Mike. Am I making any sense at all?

Mike

>Mike,
>You can call a stored procedure just like any other and as long as the database in which it is stored is open it will be found.
>
replace nArea with ClacArea() in MyView
>=tableupdate("MyView")
>
>HTH
>Caroline
>
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform