I have the following Trigger generated in my database:
SET TERM ^ ;
CREATE OR ALTER TRIGGER ATUALIZA_CODNCM FOR EST_ADICIONAIS
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
begin
UPDATE est_adicionais
set id_ncm = (select ncm.id from est_adicionais inner join ncm on
(est_adicionais.ncm = ncm.numero)
where est_adicionais.ncm = new.ncm and est_adicionais.codigo = new.codigo)
where codigo = new.codigo;
end
^
SET TERM ; ^
Except when executing the command below, have the following output:
update est_adicionais e set e.st = '010' WHERE e.codigo = 135;
Output:
Invalid token.
invalid request BLR at offset 258.
function HASHMD5 is not defined.
module name or entrypoint could not be found.
By running the Select and Update commands separately, the 2 run without any problems.