Hi all I try to get a row form my select statemnt in a trigger but I got this error unexpected token: R
CREATE TRIGGER PUBLIC.TRIGGERNAME AFTER UPDATE ON PUBLIC.CLIENTE_OFFERENTE
REFERENCING NEW ROW AS NUOVO
FOR EACH ROW
BEGIN ATOMIC
DECLARE r RECORD;
SET r=(SELECT offerta.IDIMMOBILE as ID, immobile.prezzomax as costo FROM PUBLIC.OFFERTA join immobile on immobile.idImmobile=offerta.idImmobile WHERE IDOFFERTA=NUOVO.IDOFFERTA);
IF NUOVO.STATO='Venduto'THEN
INSERT INTO PUBLIC.VENDITE(IDCLIENTE,IDIMMOBILE,COSTO)VALUES(NUOVO.IDCLIENTE,r.ID,r.costo);
END IF;
END