1 Reply Latest reply: Dec 18, 2013 12:39 AM by Sherry Feng-Oracle RSS

    Mass Deleting Supporting Documents



      We have over 6000 WMF loaded as supporting documents. We had problem in displaying those WMFs and had to convert them to JPGs and loaded all those JPGs to PLM. Since we don't need all of those WMFs now, how can we delete them in mass.

        • 1. Re: Mass Deleting Supporting Documents
          Sherry Feng-Oracle


          The function of mass deleting supporting documents is not available. But you can generate scripts to get mass deleting done.


          Due to that I don’t know the exact objects you want to delete, only valuable scripts can be supplied.


          Suppose you want to delete supporting documents, whose pkid starts with 1014, you need to generate following scripts:

          delete DrlAttachmentReference where fkOwner in (select a0.pkid from attachments a0 where a0.fkSpec = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d');

          delete attachments where fkSpec = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';

          delete gsmProductFactSheet where fkSupportingDocument = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';

          delete from gsmSupportingDocAttributes where fkAttrParentID = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';

          delete SupportingDocuments where pkid = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';


          Note: 1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d is a sample pkid in my local server. In your case, it should be replaced by the supporting document’s pkid you want to delete.


          With current spec, you can get all supporting documents’ info easily from table SupportingDocuments:

          select * from SupportingDocuments

          where fkSpec='CurrentSpecPKID '


          Please backup your DB before you run any script.