Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concatenating rows in a query, sooo slooow
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00114192
Message ID:
00114200
Views:
19
Hi Sarah,

If I understand your question correctly, you have a parameterized view where you use the INLIST and this function creates the comma delimited list for categories.

If so you could try using a select statement with the IN clause.
SELECT *;
  FROM Table1;
  WHERE Table1.cid IN (SELECT cid from Table2)
>There has got to be a better way -- I have a View which calls the program below. The idea is that the categories in the child record s are put into a single string in my (read only) view. It is very slow and I don't have many records yet.
>
>My only other idea is to save the string against the parent when the record is created, data redundancy I know but the delay would be minimal and once only and the user wouldn't really see the impact.
>
>However if there is a better way to acheive this I'd be interested in knowing.
>
>parameter tcid
>local m.lclist
>local m.lncount
>m.lclist = ""
>select distinct category ;
> from bkdata!entrydet ;
> where entryid = tcid ;
> order by category ;
> into array aCatList
>if _tally > 0
> for m.lncount = 1 to alen(aCatlist,1)
> m.lclist = m.lclist + ', '+trim(aCatList[m.lncount,1])
> endfor
> if len(m.lclist) > 2
> m.lclist = substr(m.lclist,3)
> else
> m.lclist = ""
> endif
>endif
>return padr(m.lclist,30)
>
>Thanks -- Sarah
Previous
Reply
Map
View

Click here to load this message in the networking platform