Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYNTAX ERROR on TableUpdate
Message
From
02/03/2000 01:49:46
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
To
02/03/2000 00:09:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00340313
Message ID:
00340443
Views:
23
Thanks John...that wasn't the problem... I've spent hours on it now, and it's fixed, but I don't quite understand it.

I'm working on a reservation system, and can only allow a set number of reservations for a specified time. So when the user changes the size of a group reservation, I want to guarantee the seat availability, update the information on the disk (in case others are checking availability), and then still allow the user the chance to Cancel out of the changes. The problem was in my Cancel routine.

What I was doing was, on entry to the form, SELECTing the single record in the view, ModifyGroup, to another cursor, SaveModifyGroup. ModifyGroup may or may not have changes made to it and the changes may or may not be written to the disk with a TableUpdate (if the group SIZE changes, the record is written).

When the user cancels, I copy the record in SaveModifyGroup back to ModifyGroup and the subsequent TableUpdate fails, w/the Syntax Error mentioned in my original post (I got hung up in trying to copy it back in several different ways, none of which made any difference.)

I discovered that if I copy all BUT THE PRIMARY KEY into ModifyGroup, the Tableupdate is successfull...but if fails, even when I'm writing the same value over the primary key. I guess VFP detects that it's changed? That's all I can figure out. Guess I still have a way to go to completely understand buffering and views - but, boy, since I started using views, I sure love 'em.

The buffering mode is optimistic table, if that makes any difference.

Thanks for your response...J

>That could be. Here's what you do: Edit the SQL code that creates the view and put quotes around the table name. IE:
>
>SELECT * FROM "group"
>
>This might alleviate the problem.
>
>
>>I am updating a single record in a table, Group, with a view, ModifyGroup. Probably a bad choice of table name, but it's inherited...could this be causing the problem?
>>
>>MOST of the time the TableUpdate works...
>>
>>In a certain case, after the table is updated, I want to revert to a previously saved state of the table. I REPLACE fields of the view with the previous values and when I do a TableUpdate, it fails...and AERROR() tells me: Syntax Error.
>>
>>Any help on ideas about what could be causing this, or a solution? TIA, J
Previous
Reply
Map
View

Click here to load this message in the networking platform