La siguiente declaración no cambia nada en una base de datos de Exact Online:
use 90420@eol
set use-http-disk-cache@eol false
set use-http-memory-cache@eol false
create or replace table EmployeesSoll@InMemoryStorage
as
select jte.*
from jsontable
('[*]'
passing '[{ "id":31870082, "first_name":"yyy"},{ "id":31870282, first_name":"xxx"}]'
columns EmployeeHid number path 'id'
, FirstName varchar2 path 'first_name'
) jte
synchronize EmployeesSoll@InMemoryStorage
to ExactonlineREST..Employees@eol
with insert or update
identified by EmployeeHID
triggers
instead of insert
begin
dbms_output.put_line('Insert: ' || dbms_sync.diff(:old, :new));
insert into ExactOnlineREST..Employees@eol
( EmployeeHID
, FirstName
)
values
( :new.EmployeeHID
, :new.FirstName
);
exception
when others
then
dbms_output.put_line('Error on insert employee on ' || :new.EmployeeHId || ' due to ' || sqlerrm);
raise;
end
instead of update
begin
dbms_output.put_line('Update: ' || dbms_sync.diff(:old, :new));
update ExactOnlineREST..Employees@eol
set FirstName = :new.FirstName
where EmployeeHID = :old.EmployeeHID
;
exception
when others
then
dbms_output.put_line('Error on update employee on ' || :new.EmployeeHId || ' due to ' || sqlerrm);
raise;
end
No se muestra ningún error. El conteo y el registro muestran que en realidad se actualizaron 2 filas.
La siguiente consulta sobre las llamadas reales de la API devuelve un 403 Forbidden con el código de mensaje itgenclr217:
select *
from sessionios@DataDictionary
order
by id desc
Pero no ocurre ningún error en la sincronización.
En el siguiente SQL:
update exactonlinerest..employees
set firstname='FirstName'
where employeehid=53
la actualización no surte efecto. SessionIOs muestra un itgenclr217, pero no se desata ningún error.
La tabla tiene can_insert = true y la columna tiene influences_insert = true en las tablas SystemTables@DataDictionary y SystemTableColumns@DataDictionary, respectivamente.
Un análisis del registro de llamadas nativas revela que se envía un HTTP PUT a Exact Online en la URL:
https://start.exactonline.de/api/v1/90420/payroll/Employees(guid'4662acaf-d235-4e82-9c37-da1207814736')
con carga útil:
{"FirstName":"FirstName"}
y resultado:
{"error": {"code": "", "message": {"lang": "", "value": "Forbidden"}}}
Expectativas:
- se debe mostrar un error ya que falló,
- y debería actualizar realmente los datos cuando no falle.