The GlobalIndent seems to have no effect
CompletedThe GlobalIndent seems to have no effect
The IndentInPart does have an effect and indents the From parts a bit
Ideally in the future you want an indent for the subquery as a whole i.e everything between the brackets
SELECT F1,G2
FROM xyztable
Inner join .....
left join
-----(Select j1,y2
-----From
-----Where)
Where .... etc
Not urgent
-
Yes this IndentGlobal now works, thanks .... it was a bug ..... it now indents the whole query ..... but it wasn't really the problem I wanted solving .....
Which was that I wanted the SUB QUERY parts indented more that the parent part of the query i.e. like thisSELECT F1,G2FROM xyztableInner join .....left join-----(Select j1,y2-----From-----Where-----Inner Join ....-----left join----------(Select t1,u2----------From----------Where)-----)Where .... etcNot urgent but it would make things more readable
-
Use the ActiveQueryBuilderX.SQLFormatFrom.IndentGlobal to format the query the way you need.
There are four sets of formatting options:
- SQLFormatMain - for the main query formatting
- SQLFormatFrom - for derived tables (sub-queries in the FROM clause used as datasources)
- SQLFormatCTE - for Common Table Expressions
- SQLFormatExpression - for sub-queries in expressions
-
Ah OK yes I can now see setting SQLFormatFrom to say 10 gives me almost what I want
It appears that the problem is whatever logic is used to split the Join lines (Inner Join etc) does not honour this indent for the sub query
So you end up with the select and columns indented by x spaces but when it gets to wrapping a Join line for the subquery it is wrapped to coliumn 1 and not under the I of Inner Join
Hope that makes sense
-
Thanks I have had a play with some of those and others and they do make the SQL iutput different but none of them appears to stop this type of wrapping in a subquery
--Left Join (Select qvwCampaignLinks.Contact_Ref As Contact_Ref,
qvwCampaignLinks.ID As Journal_Number
------------From qvwCampaignLinks
------------Where qvwCampaignLinks.[Key] In ('DON0002')
------------Union All
------------Select qvwCampaignLinks.Contact_Ref As Contact_Ref,
qvwRegularGivingPayments.Journal_Number As Journal_Number
------------From qvwCampaignLinks
--------------Inner Join qvwRegularGivingPayments On qvwCampaignLinks.ID =
qvwRegularGivingPayments.Agreement_Number -
FromNewLineAfterDatasource = false
FromNewLineAfterJoin = true
FromNewLineBeforeComma = false
FromNewLineBeforeJoinExpression = false
MainPartsFromNewLine = true
NewLineAfterPartKeywords = false
SelectNewLineAfterItem = false
SelectNewLineBeforeComma = false
IndentInParts = 2
IndentGlobal = 0
SQLFormatFrom.IndentGlobal = 8
Isn't it a configuration that suits your needs? -
Thanks for continuing to look at this.
I have tried your settings and although it changed the output the fundamental problem of things wrapping back to column 1 as explained above still remains
Whilst I would like this to work it is not as important to me when compared with the other two threads I replied to
Thanks again
-
I can see insert video, picture and link but nothing for file ?
If I paste it in here it looses the formatting
I've taken some screen grabs and attached as pictures, I hope you can see them
The indenting doesn't have to be EXACTLY like the second picture BUT I don't want to see anything in column 1 other than Select, From and Where of the main outer query
Thanks
Current output
Desired output
Please sign in to leave a comment.
Comments
18 comments