Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an updatable cursor using SELECT - SQL
Message
From
19/06/1999 11:14:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00231663
Message ID:
00231754
Views:
18
>I am new to this SQL stuff, and in need of advice. I am creating an SQL statement INTO a cursor. However, that cursor is read-only, and I would like to alter the information. I prefer to use a cursor, because it cleans up so easily. What is the best way to create an updateable cursor using SQL, or should I just do it the old fashioned way and scan through the table and build my own cursor (which is updateable)
>
>Thanks,
>Marcus.
As Evan said "use dbf() ... again" does the trick. But you should create a true cursor first :
select .... ;
  where .t. and lOtherExpressionIfAny ;
  into cursor myTemp && Old version FP

select .... ;
  where ... ;
  into cursor myTemp nofilter && VFP
use dbf("myTemp") in 0 again alias myUpdatable
use in "myTemp"
select myUpdatable
*Edit
MultiselectGrid class in files\classes section uses this technique :)
PS: No matter the size is cursor would be created on disk. You may not find it using explorer or file() but it's there I assure you (allocated). To easily make it evident just create an index on a field.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform