No I have no idea. But If You change the UDF to look like this did it make any difference?
LPARAMETERS lnSONum
LOCAL lnSelect,lcItemList
lnSelect = SELECT()
lcItemList = ''
SELECT ItemNum FROM SoItems WHERE SoItems.SoNum = m.lnSONum INTO ARRAY cItems
nSelected = _TALLY
FOR iSel = 1 TO nSelected
lcItemList = lcItemList + IIF(iSel == 1, ',', '') + TRANSFORM(cItems[iSel])
ENDFOR
SELECT (lnSelect)
RETURN lcItemList
>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?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.