Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make cursor read/write
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00037966
Message ID:
00038135
Vues:
42
>>
>> >>I have read somewhere that this is possible, also that it is possible to
>> index a cursor.
>> >
>> >SELECT * FROM TABLE INTO CURSOR TEMP2
>> >USE DBF('TEMP2') IN 0 AGAIN ALIAS TEMP
>> >SELECT TEMP
>> >
>> >You now have a read write cursor.
>> Michel's answer would solve the original question.
>> However, wouldn't:
>>
>> SELECT * FROM table INTO TABLE tablename
>>
>> be a better solution?
>
>There are two things to consider with this:
>
>1) you will be left with a file on disk after you close the table. With
>a cursor, it goes away on it's own.
>
>2) the file on disk will have the same name for everyone. Unless you
>take some precautions, the next user to run this function won't be able
>to finish because you'll still have the file open. With a cursor, you
>have a unique filename and you don't have to worry about colliding with
>another user.
>
>/Paul
My response to Paul's comments:
1) It is true that you are actually creating a file on disk rather than in memory only. With this appoach you should simply delete the file after your done using it.

2) I wan't referring to the word 'tablename' in 'INTO TABLE tablename' as the actual name of the table. I was just referring to it as generic name. Of course you have to use a unique name (I use "c"+RIGHT(SYS(2015),9) to get the unique name).
It's "my" world. You're just living in it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform