>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
>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