[ic] loop returns just last matches

Ed LaFrance interchange-users@interchange.redhat.com
Thu Mar 21 22:42:00 2002


At 03:02 PM 3/21/2002 -0800, you wrote:
>At 02:13 PM 3/21/02, you wrote:
>>Hi,
>>
>>I'm having a problem with [loop]. following code is looking in the
>>database "warengruppen.txt" for any item in the search field
>>"obergruppe" matching the record "02". then it's supposed to print the
>>value of "untergruppe_id". but instead of telling me that i have two
>>entries corresponding to "02" (so 7 9 is what i to expect to see on the
>>screen), it says "5 7 9". this means, it prints out every categories
>>last element. what am I missing? the same happens using one-click
>>search.
>>
>>thanks,
>>andreas

The search is returning valid results considering the way it is written. 
What is it that you want to do?  If you just want to see all unique 
utergruppe_id for one value of obergruppe (let's say "02"), try:

[loop prefix=test1 search="
         fi=warengruppen.txt
         st=text
         sf=obergruppe
         se=02
         ml=1000
         rf=utergruppe_id
         un=yes
         tf=utergruppe_id
         to=n
"]
         [test1-param untergruppe_id]
[/loop]

- Ed L.




>>[loop prefix=test1 search="
>>fi=warengruppen.txt
>>tf=untergruppe_id
>>ra=yes
>>un=yes
>>sf=obergruppe
>>se=3"
>>]
>>
>>[test1-data warengruppen untergruppe_id]
>>
>>[/loop]
>>
>>
>>this is warengruppen.txt:
>>
>>obergruppe      untergruppe_name        untergruppe_id
>>01      SCSI-Zubehör    1
>>01      mehr Hardware   5
>>02      Windows-Software        8
>>02      Spiele  9
>>03      nix     7
>
>It has been a long time since i've used this type of search
>(I only use real sql searches now), but 1 possible problem
>is the use of un=yes (unique results returned). Look over
>the docs at:
>
>http://interchange.redhat.com/cgi-bin/ic/docfly.html?mv_arg=icdatabase06%2e07
>
>and :
>
>http://interchange.redhat.com/cgi-bin/ic/docfly.html?mv_arg=icdatabase06%2e11
>
>Kyle Cook
>
>
>
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================