HomeActive Query BuilderWrapping Criteria Columns in Parentheses

Wrapping Criteria Columns in Parentheses


It appears that each of these SQL statements is displayed the same way in SQLBuilder:

SELECT * FROM TABLE WHERE A=1 OR (B=1 AND A=2)
SELECT * FROM TABLE WHERE A=1 OR B=1 AND A=2

where A=1 is in first Criteria column and B=1 AND A=2 is in next "Or..." column. When you enter criteria in mutliple columns it seems that by default SQLBuilder does not separate with paranthesis when building SQL. Is there a way to change this default or to force wrapping each criteria column in parentheses?

(I am using .net version and SQL Server)

Thanks for any guidance,
Scott.
Scott | email
November 3 2007, 08:11 AM
Dear Scott,

I'll forward your question to developers. Right now it is not possible, but this feature might be useful for many users.

Sincerely
Sergay Smagin
Sergey Smagin | email
22 hours, 41 mins since original post
Sergey,

This can be done in AQBX v 1.8.0.11 with the following:

manually entered all in the column A row of the grid:
Criteria: = 1 Or: (= 2 And TABLE.B = 1)

Not so in .NET?
Bill | email
1 month since original post
It is the way, but when you try to edit this SQL manually and then go back to the query builder, you will see criteria rearranged and parentheses lost.

UPD: The problem is solved.

More details for ActiveX Edition: http://www.activequerybuilder.com/history.html?story=26&sec=3-3
More details for VCL Edition: http://www.activequerybuilder.com/history.html?story=25&sec=3-2
More details for .NET Edition: http://www.activequerybuilder.com/history.html?story=80&sec=3-1
Sergey Smagin | email
1 month since original post
There is sample code
Benedito Santana - Brasil - SP | email
11 months, 3 weeks since original post
This topic is closed