Thursday, July 16, 2020

EAM SQL Statement to fetch the Short Term attached text for a particular EAM Work Order

-------------------------------------------------------------------------------------------------------------------
--EAM SQL Statement to fetch the Short Term attached text for a particular EAM Work Order
-- Parameters P_WIP_ENTITY_ID
--            P_ORGANIZATION_ID
-------------------------------------------------------------------------------------------------------------------
SELECT fdst.short_text,
       fdv.title,
       ad.pk1_value organization_id,
       ad.pk2_value wip_entity_id,
       fdv.media_id
  FROM fnd_documents_vl fdv,
       fnd_attached_documents ad,
       fnd_documents_short_text fdst
 WHERE 1=1
   AND fdv.document_id = ad.document_id
   AND ad.entity_name = 'EAM_WORK_ORDERS'
   AND fdv.datatype_name = 'Short Text'
   AND (security_type = 4 OR publish_flag = 'Y')
   AND fdst.media_id = fdv.media_id
   AND ad.pk2_value = :P_Wip_Entity_Id
   AND ad.pk1_value = :P_Organization_Id;

No comments:

Post a Comment