Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can SQL Cursor update existing table?
Message
 
 
To
11/03/2004 14:43:41
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00885304
Message ID:
00886533
Views:
19
So this sounds like you are selecting from a VFP table. You could convert to using a local view where TABLEUPDATE will send changes back to the source table. If you want to use the cursor, then you have to use INSERT/UPDATE/DELETE SQL commands to post your changes back to the source table. If you use table buffering, you can use GETNEXTMODIFIED() to scan through the records in the cursor to find the modified records then use GETFLDSTATE() to see what kind of SQL action needs to be taken. The other option is to just edit data directly in the table [least favored option].

>Nothing that explicit. Basically just use the:
>
>select * from customer_main_data ;
>into cursor sql_customer_main_data
>
>if the user modifies one field in the cursor sql_customer_main_data, then the customer_main_data table is open, and I guess the account name would be searched out and thus replace it somehow after it verified everything.
>
>>If it is a cursor created by something like SQLEXEC(), then you have to use SQLEXEC() to send the UPDATE command back to the server. If this is a Remote View, then you can use TABLEUPDATE() to send the edited data back to the server. However, a cursor whose source table is in a DB like SQL Server or Oracle can be made updatable so you can use TABLEUPDATE() function.
>>
>>If you provide some more information about the DB, cursor, local or remote view, etc., we can provide a better [more complete] answer.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform