当我执行如图所示的查询时,附件始终为空。我希望带有名称的附件的内容AttachmentFileName
将在列中Attachment
。
如何检索文件的 blob?
select /*+ join_set(mat, mailmessageid, 5000) */ mat.Attachment xmlfilecontents
, mat.division || '-' || AttachmentFileName filename
from mailmessagesreceived mre
join MailMessageAttachments mat
on mat.mailmessageid = mre.id
and mat.Type in ( 20, 22 ) /* 20: UBL 2.0, 22: Simplerinvoicing 1.0 */
where mre.SenderMailbox = 'Facturen@ExactOnline.nl'
and mre.created >= add_months(trunc(sysdate, -1), -10)
and mat.FileSize > 0