Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update SQL - surprise
Message
From
12/07/1998 18:36:53
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00116570
Message ID:
00116649
Views:
17
>>I got a slight surprise to see the record pointer being moved while using the SQL Update command.
>>I would have thought, that like other SQL commands, noteably SQL Select, that the record pointer wouldn't be moved.
>>I wouldn't say this was a "bug" but it would be nice to see the pointer restored automatically after the operation.
>
>Are you referring to a table open in the current select area whose pointer gets moved if a SQL is executed against other tables? I would be interested in such details.
>
>Thanks.

It was a simple
UPDATE Ops ;
   SET Extno = SPACE(4), ;
   LoggedOn = .F. ;
   WHERE Extno = app.extno
I don't really care if it's the currently selected table or not. This moves the record pointer for "Ops" to EOF(). My view is that it should not move at all. Otherwise I'd simply use the old SCAN technique
* save recno() here
SCAN FOR Extno = app.extno
   REPLACE Extno WITH SPACE(4), LoggedOn WITH .F.
ENDSCAN
*go to old recno here
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform