Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get current value in SQL SELECT from buffered tab
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00363464
Message ID:
00363477
Views:
21
>I have Buffered table and want to create SQL cursor with current value from it. But when I try:
>
> SELECT CURVAL("MyField","MyBuffTable") FROM MyBuffTable INTO CURSOR MyCursor
>
>but I receive a cursor with number of records as MyBuffTable but with the same value in every record.
>
>TIA
>

Boris,
You can't use a SQL Select on buffered tables because the select performs the equivalent of a USE ... AGAIN on the original table/view. This opens the cursor from disk and your changes are not available. That's the reason you are getting the same value. Since the select reads from a separate alias, the record pointer in the alias you specified remains in the same place.

You will probably have to use one of the xBase commands (e.g. scan/endscan) to go through your cursor and insert the records into another cursor.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform