0 Replies Latest reply on Oct 15, 2016 6:50 PM by vishm8

    Oracle Service (CS) - FND Attachments Extraction SQL Query

    vishm8

      Hi, I'm trying to extract all file attachments related to Service Requests created as part of Oracle Service product in Oracle Apps R12.1.3 instance.
      The query i'm using to do the same is,
      SELECT
                  NVL(t4.upload_date,t2.creation_date),
                  t2.last_update_date,
                  t2.document_id,
                  fuc.user_name created_by,
                  t2.file_name,
                  t5.incident_id,
                  t4.file_content_type,
                  fum.user_name modified_by,
                  t4.file_data
      FROM applsys.fnd_attached_documents t1,
                  applsys.fnd_documents t2,
                  applsys.fnd_document_datatypes t3,
                  applsys.fnd_lobs t4,
                  cs.cs_incidents_all_b t5,
                  applsys.fnd_user fuc,
                  applsys.fnd_user fum
      WHERE t1.pk1_value = t5.incident_id
            AND t1.entity_name = 'CS_INCIDENTS'
            AND t1.document_id = t2.document_id
            AND t2.datatype_id = t3.datatype_id
            AND t3.name = 'FILE'
            AND t3.language = 'US'
            AND t2.media_id = t4.file_id
            AND t2.created_by = fuc.user_id
            AND t2.last_updated_by = fum.user_id;

      Does the query look right or do i need to modify it ?
      Regards,
      Mohan