Pay attention to remarks on the SequenceNumber
described here : join-attachmentbyurl-eol-and-join-jsontables-creates-duplicate-entries
the good statement is now:
select distinct dct.division, fle.* from exactonlinerest..documents@eol dct
join exactonlinerest..documentattachmentfiles@eol dae on dct.id = dae.document
join AttachmentByUrl@eol (dae.url || '&Download=1') dcta
join jsontable
('Transactions.[*]'
passing blob_to_text(dcta.DocumentContents, 'Unicode')
columns
--bankAccountID varchar2 path '::BankAccountId'
transactiondate datetime path '.TransactionDate'
,Description varchar2 path 'Description'
--,rawData varchar2 path 'RawData'
,ownAccount varchar2 path 'Owner.BankEntity.AccountIdentification'
--,SequenceNumber varchar2 path 'SequenceNumber' -> removed since the file is downloaded 4 times/day by Eol, the same transaction can be present in the 4 json files but with different Sequence number.
,TransactionNumber varchar2 path 'TransactionNumber'
--,TransactionIdentifiers varchar2 path 'TransactionIdentifiers'
,Type varchar2 path 'Type'
,amount varchar2 path 'Amounts.[*].Value'
,CounterpartyName varchar2 path 'CounterParty.Name'
,CounterpartyAccount varchar2 path 'CounterParty.BankEntity.AccountIdentification'
) fle
where dct.type = 40 AND dct.Created > dateadd('day','-10',sysdateutc) AND dct.SendMethod = 2