We gebruiken een query om de af te drukken verkoopfacturen te bepalen op Exact Online. Dit duurt nu ruim een minuut in plaats van hoogstens enkele seconden.
Hoe komt dat?
create or replace table invoicestoprint@inmemorystorage
as
select /*+ http_disk_cache(false) http_memory_cache(false) */
sie.InvoiceID
, sie.AmountDC
, sie.InvoiceDate
, sie.InvoiceToName
, sie.OrderNumber
, sie.YourRef
, sie.Description
, sie.Currency
, 'nl' lge_code
, lyt.id
emaillayoutid
label 'Email Layout ID'
from exactonlinerest..salesinvoices@eol sie
join AccountsIncremental@eol act
on act.id = sie.invoiceto
left
outer
join exactonlinerest..layouts@eol lyt
on lyt.division = sie.division
and lyt.[type] = 2
and lyt.subject
=
case
when act.language in ('NL', 'EN')
then act.language
else 'EN'
end
|| ' Begeleidend schrijven verkoopfactuur'
where sie.status = 20 /* Not printed. */
and sie.ordernumber in
(...)
Het afdrukken gaat met:
insert into PrintedSalesInvoices@eol
( invoiceid
, sendemailtocustomer
)
select invoiceid
, false
from invoicestoprint@inmemorystorage