Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updatable SQL cursor
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00160169
Message ID:
00160172
Views:
18
Michael,

You can make a SQL cursor updateable as long as VFP created it on disk and not just as a filter of the original table. A cursor is created on disk if you use AS, join tables, add calculated fields or use a non-optimizable expression in your WHERE clause. I make sure it's on disk by using the NOFILTER clause in VFP 5 or higher or by adding a field (' ' AS Dummy, e.g.) to the field list in VFP 3.0 or earlier.

Once you have created a cursor on disk you can make it updateable like this:
USE DBF('mycursor') AGAIN IN 0 ALIAS myupdate  && mycursor is read-only
USE IN mycursor   && just to clean up
Be aware that changing the cursor won't update the base table unless you use CURSORGETPROP() to make the cursor updateable.

>Hi All,
>
>Is it possible to create an updatable cursor with
>SELECT ..... INTO CURSOR, or does one have to actually
>use SELECT .... INTO DBF ?
>
>Michel.
Previous
Reply
Map
View

Click here to load this message in the networking platform