Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sys(2015) and SELECT ... INTO Table
Message
De
21/08/2002 03:29:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/08/2002 10:32:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00691029
Message ID:
00691794
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>Hi
>
>I use a directory Tmp for all tables , that i get with
>Select ... into table .
>
>So , i whish that each table have a different name .
>
>How can i make this Select ?
>
>Select ... INTO Table SUBSTR(SYS(2015), 3, 10) ?
>
>And after , how can i select and use this table ?
>
>Thanks

Pedro,
You might use a cursor and give any name you want. Or with table you could use 'aliases' to keep track :

lcMyTable1 = sys(2015)
lcMyTable2 = sys(2015)
...
lcMyTableN = sys(2015)
Select ... INTO Table (lcMyTable1)
Select ... INTO Table (lcMyTable2)
...
Select ... INTO Table (lcMyTableN)
use (lcMyTable1) in 0 again alias 'myAlias1'
use in (lcMyTable1)
use (lcMyTable2) in 0 again alias 'myAlias2'
use in (lcMyTable2)
...

Since you now have 'known' aliases you don't need lcMyTableX variables to be scoped to other methods. At any time you could access the physical filename (drive:\path\lcMyTableX.dbf) from alias :

lcMyTable1 = dbf('myAlias1')
use in myAlias1
erase (lcMyTable1)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform