[Solved] linebreaks into brackets

8 Posts
2 Users
0 Reactions
810 Views
Posts: 36
 Idol
Topic starter
(@idol)
Member
Joined: 3 years ago
[#71]

Unpredictable behavior of  the following script :

SELECT *
FROM table1       AS t1 INNER JOIN table2 AS t2
ON  t1.id2= t2.id2

sometimes it provides:

SELECT * FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id2 = t2.id2

sometimes:

SELECT *
FROM table1       AS t1
INNER JOIN table2 AS t2
ON  t1.id2 = t2.id2

especially if it's inside brackets:

SELECT *
FROM (table1       AS t1 INNER JOIN table2 AS t2
ON  t1.id2= t2.id2)

settings was not changed during test. 

I have tried for SSMS, java and Win app. 

 

Could you please advise what can be wrong?

 

Thanks in advance

 


7 Replies
Posts: 36
 Idol
Topic starter
(@idol)
Member
Joined: 3 years ago

Of course my script is more complicated, and linebreaks do not work correctly only in Win app but fine in SSMS and java.

When I tried to simplify the example I found out the result is unpredictable.


Reply
Posts: 36
 Idol
Topic starter
(@idol)
Member
Joined: 3 years ago

I have found out why the result was different - because of "No breaks for SQL up to 80 Char.

 

However, my original issue still unresolved.

Win app does not formatted JOIN into brackets, java and SSMS do.


Reply
2 Replies
Guido
Admin
(@admin)
Joined: 5 years ago

Member
Posts: 295

@idol,

many thanks for your feedback.

You are totally correct. The option "No breaks for SQL up to 80 Char." is not available in all Apps.

And the SSMS App is runnung with the Parser Release 5

Recently I created a new parser Release 6 and it looks like I need to add a parsing rule for JOIN in brackets.

Regards

Guido

 


Reply
Guido
Admin
(@admin)
Joined: 5 years ago

Member
Posts: 295

@idol is the SQL with the JON inside brackets syntactically correct? If yes, for which dB?


Reply
Posts: 36
 Idol
Topic starter
(@idol)
Member
Joined: 3 years ago

syntax is correct, it's SQL server.


Reply
2 Replies
Guido
Admin
(@admin)
Joined: 5 years ago

Member
Posts: 295

@idol thanks for your patience. Issue is now fixed in Release 6.23.04.12

Regards

Guido


Reply
 Idol
(@idol)
Joined: 3 years ago

Member
Posts: 36

@admin thanks, it works nicely.


Reply
Share: