Beautifier problem

ScottMattes

Member³
I don't know where the first attempt at posting this went to, but here is a better example.

I have break on zero level checked and and/or under where

here is the query

Code:
SELECT *
  FROM TABLE
 WHERE (FLD1_large_field_name = FLD2_large_field_name AND FLD3_large_field_name > FLD4_large_field_name OR FLD5_large_field_name IS NULL AND FLD6_large_field_name IS NOT NULL)
and Beautifier gives me this

Code:
SELECT *
  FROM TABLE
 WHERE (FLD1_LARGE_FIELD_NAME = FLD2_LARGE_FIELD_NAME AND
       FLD3_LARGE_FIELD_NAME > FLD4_LARGE_FIELD_NAME OR
       FLD5_LARGE_FIELD_NAME IS NULL AND FLD6_LARGE_FIELD_NAME IS NOT NULL)
but I want this

Code:
SELECT *
  FROM TABLE
 WHERE (FLD1_LARGE_FIELD_NAME = FLD2_LARGE_FIELD_NAME
       AND FLD3_LARGE_FIELD_NAME > FLD4_LARGE_FIELD_NAME
       OR FLD5_LARGE_FIELD_NAME IS NULL
       AND FLD6_LARGE_FIELD_NAME IS NOT NULL)
 
I'd also like to be able to change the code displayed in the Beautifier Options dialog so that I can see the effects of the changes without having to go all the way back to the SQL window (especially if I didn't like what I see, by that time I have already saved the changes!)
 
If you use parentheses for the whole where clause, then the beautifier will not consider this as "zero-level". You will need to remove the parentheses.
 
Marco,
Sorry, the example was too simple. Where I found the problem was in a query that had

where ( x=y or z=q )
and ( a is null or b is not null )
and ( t 8 or ( 34 and tt ) )

AND there were some long field names which further changed the look
 
I would like to see something like this

Code:
WHERE (X = Y
        OR Z = Q)
   AND (A IS NULL
        OR B IS NOT NULL)
   AND (T <> 8
        OR (3 <> 4
            AND T <> T))
 
This format is not supported. The best you can get is:
Code:
where (x = y or z = q)
  and (a is null or b is not null)
  and (t <> 8 or (3 <> 4 and t <> t))
 
Yup, and it looks real nasty when there are some long field names - ugly wrapping.

Can it be added to the list of requested enhancements?

Thank you.
 
Back
Top