Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get current value in SQL SELECT from buffered tab
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00363464
Message ID:
00363477
Vues:
24
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform