public void WhereParenthesis3() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.OpenParenthesis(3); w.Or(); w.IsNULL("a", "b"); w.CloseParenthesis(); w.And(); w.OpenParenthesis(); w.Or(); w.IsNULL("c", "d"); w.CloseParenthesis(2); w.And(); w.Less("ls"); w.CloseParenthesis(); w.Greater("gr"); string result = w.GetSql(); string sql = "((([a] IS NULL OR [b] IS NULL) AND ([c] IS NULL OR [d] IS NULL)) AND [ls]<@ls) AND [gr]>@gr"; Assert.AreEqual(sql, result); }
public void WhereParenthesis1() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.OpenParenthesis(); w.Or(); w.IsNULL("a", "b", "c"); w.CloseParenthesis(); string result = w.GetSql(); string sql = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)"; Assert.AreEqual(sql, result); }
public void WhereParenthesis1() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.OpenParenthesis(); w.Or(); w.IsNULL("a", "b", "c"); w.CloseParenthesis(); string result = w.GetSql(); string sql = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)"; Assert.AreEqual(sql, result); }
public void WhereParenthesis3() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.OpenParenthesis(3); w.Or(); w.IsNULL("a", "b"); w.CloseParenthesis(); w.And(); w.OpenParenthesis(); w.Or(); w.IsNULL("c", "d"); w.CloseParenthesis(2); w.And(); w.Less("ls"); w.CloseParenthesis(); w.Greater("gr"); var result = w.GetSql(); var sql = "((([a] IS NULL OR [b] IS NULL) AND ([c] IS NULL OR [d] IS NULL)) AND [ls]<@ls) AND [gr]>@gr"; Assert.Equal(sql, result); }
public void WhereParenthesis1() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.OpenParenthesis(); w.Or(); w.IsNULL("a", "b", "c"); w.CloseParenthesis(); var result = w.GetSql(); var sql = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)"; Assert.Equal(sql, result); }
public void WhereParenthesis2() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.Equal("id"); w.OpenParenthesis(2); w.IsNULL("a", "b", "c"); w.CloseParenthesis(); w.Or(); w.OpenParenthesis(); w.And(); w.IsNULL("d", "e", "f"); w.CloseParenthesis(2); string result = w.GetSql(); string sql = "[id]=@id AND (([a] IS NULL AND [b] IS NULL AND [c] IS NULL) OR ([d] IS NULL AND [e] IS NULL AND [f] IS NULL))"; Assert.AreEqual(sql, result); }
public void WhereParenthesis2() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.Equal("id"); w.OpenParenthesis(2); w.IsNULL("a", "b", "c"); w.CloseParenthesis(); w.Or(); w.OpenParenthesis(); w.And(); w.IsNULL("d", "e", "f"); w.CloseParenthesis(2); var result = w.GetSql(); var sql = "[id]=@id AND (([a] IS NULL AND [b] IS NULL AND [c] IS NULL) OR ([d] IS NULL AND [e] IS NULL AND [f] IS NULL))"; Assert.Equal(sql, result); }