Oracle iExpense attachment for every report will get stored in fnd_lobs table. There is table fnd_attached_documents in which column pk1_value stores line_id for expense report which you can join with ap_expense_report_lines_all. Media_id column from fnd_documents will be file_id in fnd_lobs table.
SELECT *
FROM fnd_lobs
WHERE file_id IN
(SELECT fd.media_id
FROM fnd_documents_tl fdtl,
fnd_documents fd,
fnd_attached_documents fad
WHERE fdtl.document_id = fd.document_id
AND fd.document_id = fad.document_id
AND fad.entity_name = 'OIE_LINE_ATTACHMENTS'
AND fad.pk1_value = '204771') -- line_id from expense line
SELECT *
FROM fnd_lobs
WHERE file_id IN
(SELECT fd.media_id
FROM fnd_documents_tl fdtl,
fnd_documents fd,
fnd_attached_documents fad
WHERE fdtl.document_id = fd.document_id
AND fd.document_id = fad.document_id
AND fad.entity_name = 'OIE_LINE_ATTACHMENTS'
AND fad.pk1_value = '204771') -- line_id from expense line
No comments:
Post a Comment