SQL Formatter Options

Output Format

The Output Options in the SQL Formatter Tool allow you to control the layout and formatting rules for the SQL output. These settings enable you to fine-tune the maximum line length and manage sections of code where formatting is intentionally disabled.

Max Line Length (ID022)

Sets the maximum number of characters per line in the formatted SQL output. The default value is 9999, which allows very long lines.

Use Case:

    • Shorter line lengths (e.g., 80) improve readability, especially in environments with limited screen space.
    • Longer line lengths allow for denser, more compact formatting.

Formatting On/Off

No Formatting Between (ID105)

Enables the ability to exclude specific sections of SQL code from formatting. You can specify the string also at the line end of your SQL Statement. 

When checked, the formatter will ignore the code between two specified markers:

    • -- FORMAT_OFF (ID106): Marks the beginning of the unformatted section.
    • -- FORMAT_ON (ID107): Marks the end of the unformatted section.

Use Case:

Useful when certain SQL sections (e.g., legacy code, preformatted blocks, or comments) must retain their original formatting.


Example: The following 2 examples have identical meaning

select
-- FORMAT_OFF
dept_nbr ,
depart_name,
-- FORMAT_ON
employee_name as name
from dept
where dept.dept1 = employee.dept1
select    
dept_nbr , -- FORMAT_OFF
depart_name, -- FORMAT_ON
employee_name as name
from dept
where dept.dept1 = employee.dept1