Hi. I made an example of the gaps I have trying to format some statements.
Can you give me a glue, what's wrong?
begin
select *
from tab1
where col1 = 1
and colb = '1'
and
( --Case 1: OK parentesis in the new line
colz is not null --OK contents in the new line and indented
and colz = 'X' -- OK 'and' in the new line
)
and --retyping the previous statement and including more statements
( --Case 2: OK parentesis in the new line
col1 = 'd'
and
(
colz is not null --OK contents in the new line and indented
and colz = 'X' -- OK 'and' in the new line
)
)
and ( --Case 3: NOT OK parentesis not in the new line
( --parentesis not indent, the difference between Case 2 and Case 3 is the "cola = 'd' and"
colz is not null --OK contents in the new line and indented
and colz = 'X' -- OK 'and' on the new line
)
)
and exists --OK: and exists on the new line
( --Case 4: NOT OK: parentesis aligned to the where, not aligned to the 'and exists' or indented to the 'and exists'
select * from tabB
);
end;
Attached, a picture of my SSMS screen and my format style.
Can you give me a glue, what's wrong?
Attached, a picture of my SSMS screen and my format style.