Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting a record from a multitable view
Message
 
 
To
05/08/2007 13:10:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01246019
Message ID:
01246039
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform