It's necessary to call this from a SQL-select because the computer inserting the records is not necessarily the computer running the SQL-Select statement. This application typically involves multiple computers.
Here's the thing that baffles me:
One computer inserting records will issue (simplified version)
insert into sohead (sonum) values (lnSONum)
insert into soitems (itemnum) values (lnItemNum)
flush
Then another computer will run the SQL-Select query and it will immediately see the new records in the sohead table but won't see the new records in the soitems table.
Another thing occurred to me that might be a little different. The UDF that the SQL-Select statement calls uses the soitems table again like such
lparameters lnSONum
local lnSelect,lcItemList
lnSelect=select()
lcItemList=''
use soitems in 0 shared alias soitems_again
sele soitems_again
locate for sonum=lnSONum
do while found()
lcItemList=lcItemList+iif(!empty(lcItemList),',','')+alltrim(str(soitems.itemnum))
continue
enddo
use in soitems_again
select (lnSelect)
return lcItemList
Any idea if using the table again can cause Foxpro to only look in the cache rather than looking on the drive?
Brandon Harker
Sebae Data Solutions