home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / 7815 < prev    next >
Encoding:
Text File  |  1992-11-13  |  1.4 KB  |  35 lines

  1. Newsgroups: comp.databases
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!uwm.edu!linac!uchinews!machine!chinet!les
  3. From: les@chinet.chi.il.us (Leslie Mikesell)
  4. Subject: Re: Help!-searching FOXPRO string fields
  5. Message-ID: <BxMFn9.266@chinet.chi.il.us>
  6. Organization: Chinet - Public Access UNIX
  7. References: <92317.100703JBC103@psuvm.psu.edu>
  8. Date: Thu, 12 Nov 1992 20:59:32 GMT
  9. Lines: 24
  10.  
  11. In article <92317.100703JBC103@psuvm.psu.edu> <JBC103@psuvm.psu.edu> writes:
  12. >We are currently evaluating FOXPRO (for DOS-I don't think windows version is
  13. >out yet).  One problem we're having is searching alphanumeric (string) fields.
  14. >We want to be able to match part of the field, ie. if the field contains
  15. >the words "Student address list" we may want to search for every record with
  16. >the word "address".  In Paradox, we would search for "..address..", but we
  17. >haven't been able to find a similar function in Foxpro.  Any help would be
  18. >appreciated.
  19.  
  20. One way is the $ operator used as <expC1> $ <expC2> which returns true
  21. if <expC1> is contained in <expC2>
  22.  LIST FOR 'address' $ lower(data_fld)
  23.  (or LOCATE FOR, etc.)
  24.  
  25. Or you can use an SQL select where _ is a single unknown character, % is
  26. a sequence of unknown characters:
  27.  SELECT * ;
  28.   FROM table;
  29.   WHERE tabel.data_fld like "%address%";
  30.   INTO CURSOR QUERY
  31. (or WHERE lower(table.data_fld) LIKE "%address%"; if you want upper/lower)
  32.  
  33. Les Mikesell
  34.   les@chinet.chi.il.us 
  35.