itgenoda042
Statement #1 ‘select * from … 5342395E19’) s" starting on line 1 caused an error.
The requested OData URL could not be found on the AFAS Online server.
The remote server returned an error: (404) Not Found.
Please contact Invantive Support or use another table. https://(omgeving).rest.afas.online/profitrestservices/subjectconnector/1634/ef6dfc0430944e5482d33e5342395e19?take=50000
This question was automatically closed after 1 week of inactivity. The last answer given has been marked as the solution.
If the problem occurs again, please ask a new question via a separate topic. Please include a link to this topic in the new question by pasting its URL into the text.
Ultimately, the documents can indeed be found; some of the documents return an (undocumented) HTTP 404. The suspicion is that a 404 on Subject means: “No permissions”.
Query:
--
-- In case any document to which access seems impossible: ignore it.
--
-- Raises 404 Not Found when not accessible:
--
-- The requested OData URL could not be found on the AFAS Online server.
-- Please contact Invantive Support or use another table.
-- (https://93926.rest.afas.online/profitrestservices/subjectconnector/9520/90b21cfe240a4213805a164886ba6927?take=50000).
--
-- The 404 can not be answered from document cache on Subject connector, so it will consume
-- approximately 125 ms for each row on every run.
--
set ignore-http-404-errors@afas true
create or replace table tstdoc@sql
as
select m.attachment_id
, m.subject_id
, m.file_id
, m.file_name
, s.filedata
, s.mimetype
from AfasOnline.GetConnector.profit_subject_attachments@afas m
join Subject@afas(m.subject_id, m.file_id) s
--
-- Possibly forwardable server-side filter.
--
where m.file_name like 'I________.pdf'
--
-- Fine-tuned check that the invoice file name pattern is matched.
--
and regexp_instr(m.file_name, '^I[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].pdf$') = 1