为了遵守法规,我尝试从我的某些部门下载购买发票文档(作为PDF文件),以便将它们保存在磁盘上以便存档。
我使用Invantive Query Tool来执行此操作。我想知道使用哪个表以及如何仅在购买发票文档中导出这些附件。
答案 0 :(得分:2)
您确实可以使用Invantive Query Tool或Invantive Data Hub中的导出选项来完成此操作。
您需要的是一个查询,它将类型20(购买发票)的文档信息与实际附件文件挂钩。您可以在DocumentTypes
视图中找到类型及其说明的列表。您可以在DocumentAttachmentFiles
表中找到文档附件文件。
检索完毕后,可以使用local export documents
语句将该查询中的文档导出到磁盘。
完整查询在此处:
use 123456
select /*+ join_set(dae, document, 10000) */ attachmentfromurl
, dct.division || '/' || dae.id || '-' || filename
filepath
from exactonlinerest..documents dct
join DocumentAttachmentFiles dae
on dae.division = dct.division
and dae.document = dct.id
where dct.Type = 20
order
by dct.division
, dae.id
local export documents in attachmentfromurl to "c:\temp\docs" filename column Filepath
确保在use
语句中设置分部的ID(这是技术ID,而不是'分区号',可以包含重复项)。您可以在分区下的顶部菜单栏中找到它。或者只需使用use all
从所有部门获取文档(这可能需要一段时间)。
同时将文件路径设置为c:\temp\docs
所在的位置。然后在查询工具中按F5执行,或从Data Hub运行脚本。