Formatter trigger fail

I trimmed a formatter failing valid compiling trigger down to demonstrate where it is failing when it sees the LOOP. Can this be reproduced and corrected? Using 17.1 x64.

[Error] Syntax check (18: 39): ERROR: line 18, column 39, ending line 18, column 42: Found 'LOOP': Expecting: ..

CREATE OR REPLACE EDITIONABLE TRIGGER cost.z_am_01
AFTER INSERT OR DELETE OR UPDATE OF kcclc
ON cost.fe65
REFERENCING OLD AS old NEW AS new
FOR EACH ROW
DECLARE
lnum_bea_besa_jnlu_xref_qy PLS_INTEGER := 0;
BEGIN
FOR lrec_fj13
IN (SELECT (wkccdi || cowkei || joseri) AS icn_id
FROM cost.fj13
WHERE fj13.fiscal_year_id = :new.fiscal_year_id
AND fj13.wkccdf = :new.wkccd
AND fj13.cowkef = :new.cowke
AND fj13.joserf = :new.joser
AND fj13.kopcd = :new.kopcd
AND fj13.kowkt = :new.kowkt
AND fj13.kolbp <> 0) LOOP
SELECT COUNT ( * )
INTO lnum_bea_besa_jnlu_xref_qy
FROM cost . bea_besa_jnlu_xref
WHERE fiscal_year_id = :new . fiscal_year_id
AND fcn_id = ( :new . wkccd || :new . cowke || :new . joser )
AND keyop_id = ( :new . kopcd || :new . kowkt )
AND shop_cd = :new . shnbr
AND ts_tsd_cd = :new . wcnbr
AND icn_id = lrec_fj13 . icn_id ;
END LOOP;
END;
/

I can reproduce this in 17.1. It has been resolved in the most recent release, Toad for Oracle 2024 R2.

1 Like