Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Are There Any Simple For This?
Message
De
18/07/2001 07:24:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/07/2001 07:20:27
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00531899
Message ID:
00531904
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>>Hello everyone,
>>
>>I have many small tables with different names but identical structure, my task is to extract some data from each of them and append into a cursor. The only way I can do this is to save the data from small tables into an array, then put them into the cursor, but I feel this not the best way, I want to transfer the data directly but not through the array.
>>
>>The way I want to do is:
>>
>>Create Cursor MyCursor
>>FileList=adir(SmallTable_xx.dbf)
>>
>>For each SmallTable in FileList
>>  Extract useful data from SmallTable
>>  Insert the data into the Cursor &&such that no need to sort afterward
>>Endfor
>>
>>
>>
>>Is it possible to open 2 tables at the same time, then put the data from one to another? If yes, would someone please teach me how? Or any other suggestions?
>>
>>Thanks in advance!!
>
>Jimi,
>You can open as many tables as you want at a time (up to workarea limit:) but you shouldn't need it.
>
>
>FileCount=adir(arrTables,cTablePath+'\*.dbf')
>use (cTablePath+arrTables[1,1])
>afields(arrStruc)
>use
>Create Cursor MyCursor from array arrStruc
>
>For ix=1 to FileCount
>  select * from (cTablePath+arrTables[ix,1]) ;
>    where myUsefullCriteria ;
>    into cursor Temp ;
>    nofilter
>  select myCursor
>  append from dbf('Temp')
>  use in 'Temp'
>  use in (juststem(arrTables[ix,1]))
>Endfor
>
Cetin

Jimi,
Code is not as is run. Some correction it needs :)
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform