1 Reply Latest reply on Aug 10, 2014 7:36 AM by philmodjunk

    Compare field/data with many records

    firebase

      Title

      Compare field/data with many records

      Post

           what is the best way to compare a variable to all records of one table.

           for example variable $url contains www.spam.com and my blacklist table contains a few records also "spam", in this case a true will tell my script to ignore it.

           So far i use

           PatternCount($URL ; tbl_blackelist::blacklist)

           But this only returns the result of the first record.

        • 1. Re: Compare field/data with many records
          philmodjunk

               It depends on the design of your database and what you are trying to accomplish.

               Just a bit of a wild guess here as to what you are trying to do, but you could perform a find that omits all records where Blacklist contains the specified text.

               #On a layout based on tbl_BlackList...
               enter Find mode [] ---> clear the pause check box
               Set Field [Tbl_BlackList::blackList ; "*" & $URL & "*" ]
               Omit Records ---> when in find mode, this step selects the "omit" option for the current find request
               Set Error Capture [on] --> keeps an error dialog from interrupting the script if no records are found
               Perform Find []

               The resulting found set will not have any records where BlackList contains the data specified in $URL