Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting a record from a multitable view
Message
 
 
À
05/08/2007 13:10:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01246019
Message ID:
01246039
Vues:
25
This message has been marked as the solution to the initial question of the thread.
>Hi Naomi,
>
>With the following code, I get an update conflict...
>
>
>My other option has been to do a parent table record delete followed by a tableupdate, but it is not working.
>
>My code:
>
>SET MULTILOCKS ON
>CURSORSETPROP('Buffering', 5, "stockbook")
>select vuestock
>DELETE
>TABLEUPDATE()
>
>
>Thanks very much,
>
>Steve

Hi Steven,

Something is wrong here. The view is opened in 3 buffering mode by default, though I always prefer to use table buffering for the view. You don't need to buffer underlying tables as well (this is called 'double buffering').

In addition, the tableupdate needs to include parameters and we should always test its return value, e.g.
SET MULTILOCKS ON
CURSORSETPROP('Buffering', 5, "vuestock") && assuming that vuestock is a view
select vuestock
DELETE
if not TABLEUPDATE(.f., .f., 'ViewStock') 
  aerror(laError)
  =messagebox('Error occurred " + laError[2])
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform