Formatting in a loop

My formatter is not formatting anything in between a for loop's sql. All my formatting works, but when i format anything in a for loop sql that particular code does not get formated. This just started to happen in 16.1

CREATE OR REPLACE PACKAGE BODY xxx AS
    PROCEDURE test AS
    BEGIN
        FOR x IN (
          SELECT col1,
                          col2,
       col3
  FROM tbl1
 WHERE col1 = 1 AND col2 = 2
 AND col3 = 3                 AND col4           = 4

  )LOOP

                    NULL;
                       END LOOP;
    EXCEPTION
        WHEN OTHERS THEN
            RAISE;
    END;
END;
/

the sql should look like

SELECT col1,
       col2,
       col3
  FROM tbl1
 WHERE col1 = 1 AND col2 = 2 AND col3 = 3 AND col4 = 4

At my place this code formats nicely ...

Would it be possible to tell met the file version number of the file QP5.dll in your Toad folder please? The first two parts will do, for instance 5.381.

Thanks,
Andre

image

I also uploaded my FmtPlus.opt
FmtPlus.txt (1.5 KB)

so i reset my settings and the inner sql is formatting

So, if I may know, what was the actual reason then? :slightly_smiling_face:

Are you asking me? I reset my settings to see if i can fix the formatting and it did. Over the years I got used to blowing away my settings and restoring them manually.

Ok Marc, thanks.

FYI, i reverted back the formatter settings, attached in the 1st msg, and I was able to repro. If you can check out why, it would be great

So today, i replace the qp5.dll with the Toad for Oracle 2022 R2 Edition\Toad for Oracle 16.0 version and the formatting is fixed.

I had the same problem. I am om Toad 16.1.53.1594. I solved it by NOT checking "Position DO / LOOP on the same line, not on the next line". If this was checked, the query part of the loop was not formatted.