Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining two cursors
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00019482
Message ID:
00019494
Vues:
42
>>>>>I want to combine the contents of two cursors into another cursor. Is this possible? Both cursor have the same number of fields and the same field names.
>>>> Yes -- cursors are quite flexible, though they are readonly when created from SQL. You can write to them also if you CREATE them or USE dbf('cursorname') again alias newname...
>>>
>>>I have two SQL SELECT statements that query two different tables that use the same field names. I need to produce a report based on this, so I thought I could select into two separate cursors and then combine the cursors. Do you have any suggestions on how I could accomplish this?
>>>
>>>Thanks!
>>
>>assuming cursora and cursorb are built,
>>
>>select cursora.*, cursorb.* from cursora, cursorb where [join condition] into cursor cursorc.
>
>I'm not sure what he wants to do. If he does this, he'll get twice as many vars with _a, _b etc. Maybe he wants this? I don't know...
>
>If he just wants to append, he can use dbf('cursora') again in o alias cursorc and then do something like
>
>for i = 1 to reccount('cursorb')
> insert into cursorc etc...
> skip 1
>endfor
>
>then maybe index on cursorc for report...
>
>What is it you're trying to do Jeff?

Let's say cursora has 10 records and cursorb has 15. I want to have a cursor that has 25 records.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform