4 Replies Latest reply on Nov 28, 2009 10:04 AM by Sorbsbuster

    Remove multi pictures from container fields

    jschvili

      Title

      Remove multi pictures from container fields

      Post

      We have a very big(2GB) product database that contains thousands of pictures in container fields. Most of those picture don't fill any purpose, therefore i like to remove them.

       

      But...

       

      How do I remove so many pictures? Can I write a script that replace the pictures with "" in all found set? How do I write that script?

       

      and...

       

      Does the pictures disappear fully or is it still laying somewhere and take room? 

        • 1. Re: Remove multi pictures from container fields
          raybaudi
            

          Hi

           

          1) make a backup copy of your file
          2) create a new script:

           

          Go to Record [ first ]
          Loop
          Set Field [ YourTable::YourContainerField ; "" ]
          Go To Record [ next ; exit after last ]
          End Loop

           

          3) find records that you want to delete
          4) fire the above script.


          • 2. Re: Remove multi pictures from container fields
            jschvili
              

            Thanks a lot, Daniele! Isn't just forums amazing!?

             

            Does the replacement of the picture with a "" makes the picture dissappear from the database completely or is it still laying somewhere and take up room?

             

            Is it possible to use the search criteria "contain picture" in search? Like if I want to search for all records that contains a picture?

             

            Thanks again!

            • 3. Re: Remove multi pictures from container fields
              raybaudi
                

              jschvili wrote:

               

              Does the replacement of the picture with a "" makes the picture dissappear from the database completely or is it still laying somewhere and take up room?


              The pictures will be lost forever ( see point 1. )

               


              jschvili wrote:

               

              Is it possible to use the search criteria "contain picture" in search? Like if I want to search for all records that contains a picture?


               

              Create a calculated field, result number and calc: not IsEmpty ( YourContainerField )

               

              After that you can search for 1 in that field.



              • 4. Re: Remove multi pictures from container fields
                Sorbsbuster
                  

                If you have created a 2GB file by storing the pictures themsleves in the container filed, I suggest you would look to store them as a 'Reference Only'.  Storing any file inside the container field will blow up your FM file very quickly, but the 'Reference only...' option will keep it very small.

                 

                Also, if you 'Delete' the  contents of the Container Field you will only delete the link, not the picture itself.  You could re-make the link again later if you wanted.

                 

                The only downside is that if you are using the database off-line (such as travelling with your laptop) then the pictures will not be available if they are stored back at base on a file server, for instance.

                 

                The way round that is to take the FM database and the folder of images with you (if that is possible).  The total size of data you will copy and take with you will be very much smaller.  For example:

                FM File 100MB + Images 100MB stored as 'Reference Only...'  = Total size 200MB-ish

                FM File 100MB + Images 100MB stored in the Container  = So Many MB you won't believe

                 

                Alan