8 Replies Latest reply on Dec 14, 2009 1:56 PM by comment_1

    Deleting a Found Set in a script

    RCaauwe

      Title

      Deleting a Found Set in a script

      Post

      I am using Filemaker Pro 10 on a Mac.

      I will be importing a very large database (from the FAA)occasionally, but I only am interested in a much smaller number of records.  Since their database is so huge, I would like to delete, with a script, all of the records I don't need.  One field contains a Code number.  I want to delete all the records that are <7104605 and >7104622.

      My script looks something like this:

       

      GoTo Layout (name of layout)

      Enter Find Mode

      Perform Find  (<7104605)

      Extend the Found Set (>7104622)

      ???????????  (what can I put here to delete the found set?)

      GoTo layout (original)

       

      I can't find the option to Delete Found Set.  I know I could probably do this manually each time, but it would be nice to let a script do it.

       

       

       

       

        • 1. Re: Deleting a Found Set in a script
          philmodjunk
            

          Delete All Records

           

          Will actually delete all records in the found set rather than what its name might suggest.

          • 2. Re: Deleting a Found Set in a script
            RickWhitelaw
              

            It seems from your post that you're trying to keep only records between 7104605 and 7104621. That seems odd. If you're actually doing the opposite (deleting this set) do this: 

             

            Make your find request based on the range of values, e.g. 7104606...7104621 then Delete All Records. This deletes the found set.

            If you really are trying to do what your post seems to say, select all records, perform the find above, omitting (an option) records  7104605 to 7104621, then delete the found set. Back up the file before doing this!

            • 3. Re: Deleting a Found Set in a script
              TSGal

              RCaauwe:

               

              Thank you for your post.

               

              Another option is to find the records you want to keep, show omitted records, and then delete, thereby leaving the small set of records.  For example:

               

              Go to Layout [ <name of layout> ]

              Enter Find Mode []

              Set Field [ <name of field> ; "7104605...7104622" ]

              Perform Find []

              Show Omitted Only

              Delete All Records []

               

              ------

               

              If you need clarification for any of the above steps, please let me know.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Deleting a Found Set in a script
                RCaauwe
                   That's what I'm doing.  What I was trying to prevent, was importing all 1.5 million records from the FAA's database, when I only am interested in about 1250 of them.  No matter what I do, the program is going to "look" at all 1.5 million to determine which records I want to keep.
                • 5. Re: Deleting a Found Set in a script
                  philmodjunk
                    

                  RCaauwe wrote:
                  That's what I'm doing.  What I was trying to prevent, was importing all 1.5 million records from the FAA's database, when I only am interested in about 1250 of them.  No matter what I do, the program is going to "look" at all 1.5 million to determine which records I want to keep.

                   

                  Yep, no other way to do it. "Clairvoyant" databases simply don't exist. :smileywink:

                   

                  If it doesn't "look" it has no way to tell which entries match your criteria as you've discovered. Short of getting the FAA database to query its records for you, there's no alternative--nor will there be for any other database application you might choose to use.


                  • 6. Re: Deleting a Found Set in a script
                    StellaLuna
                      

                    FileMaker is TERRIBLY slow when deleting records (I haven't seen anything to compare in how slow it is).  It deletes something like only 25 records at a time.  It cannot drop tables nor can it clone and create an empty table.  It is amazing that one can clone an entire file very quickly but deleting records from one table takes ages longer ... but that's the way it is.

                     

                    I don't know what FAA is but check and see if you can get a sub-set of records (via SQL query).  It is much quicker to only import what you need than to delete records back out. At least this has been my experience. :smileyhappy:

                    • 7. Re: Deleting a Found Set in a script
                      philmodjunk
                         The other option, discussed in a different thread on this topic, is to set up a validation that excludes all records not matching the desired criteria. That should be faster than importing everything and then deleting the unwanted records, but still requires Filemaker to "look" at the record in order to use the validation to either import or ignore each record.