Met de volgende queries halen we alle tekeningen op en relateren die aan de werkorders op basis van artikel:
create or replace table dct@inmemorystorage
as
select dctx.attachments_document_item_code_attr itemcode
, coalesce(normalize(dctx.attachments_document_item_code_attr, 60, false), 'none')
|| '-'
|| 'dct-'
|| to_char(dctx.attachments_document_number_attr)
|| '.'
|| coalesce(lower(regexp_replace(dctx.name, '[^.]*\.', '')), 'bin')
filename
, dctx.attachments_document_number_attr hid
, dctx.attachments_document_item_id_attr itemid
, dctx.attachments_document_item_code_attr itemcode
, dctx.binarydata
, dctx.attachments_document_subject subject
, dctx.name originalfilename
from exactonlinexml..documentattachments dctx
where dctx.attachments_document_item_id_attr is not null
create or replace table sor@inmemorystorage
as
select sor.*
, igp.code itemgroupcode
, normalize(itm.code, 60, false) itemcodedirectory
from exactonlinerest..shoporders sor
join exactonlinerest..itemsincremental itm
on itm.id = sor.item
join exactonlinerest..itemgroups igp
on igp.id = itm.itemgroup
Merk op, het veld item
zit niet in de Exact Online REST API-versie van documentbijlages. Daardoor moeten we momenteel alle documenten ophalen via de XML-API tabel ExactOnlineXML..DocumentAttachments
. Dit duurt per keer 18 uur.
De XML API Documents
heeft een variant DocumentsEx
waar je ook documenttype en de aanmaakdatum kunt meegeven, maar die zit niet in DocumentAttachments
.
De volgende query duurt maar een paar seconden:
select *
from exactonlinexml..documentsEx
( Params_DateCreated_From => trunc(sysdate) - 60
, Params_Type => 139
)
Is het ook mogelijk een *Ex
-versie te maken van ExactOnlineXML..DocumentAttachments
waar je tenminste de aanmaakdatum (Params_DateCreated_From
) en het type 139 (“Tekening”, via Params_Type
) kunt meegeven?