You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I write a lot of SQL queries for SAP BusinessObjects reports. These have a @Prompt expression which allows the statement to take input from the user when it is run. Unfortunately, these only work when the entire expression is on a single line:
WITH "params"AS (
SELECT
@Prompt('Username', 'A', , Multi, Free, Persistent, { 'PRODUCT', 'MODEL_OFFICE' }, User:0) :: textas user,
@Prompt('Date from','D', , Mono, Free, Persistent, , User:1) :: timestamp with time zone at time zone 'UTC'as from_date,
@Prompt('Date to', 'D', , Mono, Free, Persistent, , User:2) :: timestamp with time zone at time zone 'UTC'as to_date
)
SELECT
...
But SQL Formatter will reformat these into a much more sensible multiline presentation, which I then need to change back to single-line.
Is there a feature to make the formatter skip individual lines or sets of lines in the query?
For instance, the black formatter for Python supports # fmt: off and # fmt: on comments:
I write a lot of SQL queries for SAP BusinessObjects reports. These have a
@Prompt
expression which allows the statement to take input from the user when it is run. Unfortunately, these only work when the entire expression is on a single line:But SQL Formatter will reformat these into a much more sensible multiline presentation, which I then need to change back to single-line.
Is there a feature to make the formatter skip individual lines or sets of lines in the query?
For instance, the
black
formatter for Python supports# fmt: off
and# fmt: on
comments:black
would format the above like this:The text was updated successfully, but these errors were encountered: