Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Refresh Header-Good, Items-Bad
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00984056
Message ID:
00984183
Views:
29
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 = ''
 ** I hope You have an Index by SoNum in SoItems
 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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform