Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert a cursor from temporary to permanent
Message
De
15/02/2002 00:40:25
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
14/02/2002 15:47:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00619899
Message ID:
00620505
Vues:
26
>>BTW
>>Hate this sys(2015). Everytime it crashes, I just see cryptic names. Have automated complex rekursive integrety checks controled by metadata over my tables where I crossed the same SELECT ... INTO n times. I prefer speaking names like Test_099 for test in 99th rekursion ...
>
>And how does that work for a network? The reason I use sys(2015) is to avoid two users creating the same filename on the network. Of course, if you are sure you can access getenv("temp"), you can create files on your local drive.

It is cruel I know. I don't need or want to do this on a network - it is only for local processes. So it shoud be on local computer to avoid network traffic.
I started this before I found SYS(2015) and now I'm used to. ::)

I figure out TempPath THEN I do something like

lcPath = ADDBS(GETENV("TEMP"))
lcTable = 'Test'
lcTable_ = lcTable
lnLoop1 = 1
DO WHILE USED(lcTable_) OR FILE(lcPath+lcTable_+'.dbf')
lcTable_ = lcTable+'_'+TRANSFORM(lnLoop1)
lnLoop1 = lnLoop1+1
ENDDO &&USED(lcTable_)

lcTable = lcTable_
lcTable_ = lcPath+lcTable_
CREATE TABLE lcTable_ (...)
INSERT INTO (lcTable) (...


If you avoid the OR FILE(lcPath+lcTable_+'.dbf') clause you can generate speaking cursor names as well.

This is useful in debugging iterations or rekursions.
I have an UDF with Filename as parameter and return is the free name.

>
>You could also use "DescriptiveTableName_" + sys(2015).
The solution above give me iteration deepness


Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform