38 q.baseTableName =
"bbc"
39 q.addColumn(
null,
"name");
40 c = q.createMatchCriterionString(
null,
"name",
41 Ci.sbISQLBuilder.MATCH_EQUALS,
44 sql =
"select name from bbc where name = 'o''boy'";
48 q.baseTableName =
"bbc"
49 q.addColumn(
null,
"name");
50 c = q.createMatchCriterionNull(
null,
"name",
51 Ci.sbISQLBuilder.MATCH_EQUALS);
53 sql =
"select name from bbc where name is null";
57 q.baseTableName =
"bbc"
58 q.addColumn(
null,
"name");
59 q.addOrder(
null,
"name",
true);
60 sql =
"select name from bbc order by name asc";
64 q.baseTableName =
"bbc"
65 q.addColumn(
null,
"name");
66 q.addColumn(
null,
"region");
67 q.addOrder(
null,
"name",
true);
68 q.addOrder(
null,
"region",
false);
69 sql =
"select name, region from bbc order by name asc, region desc";
73 q.baseTableName =
"bbc"
74 q.addColumn(
null,
"name");
75 c = q.createMatchCriterionIn(
null,
"name");
79 sql =
"select name from bbc where name in ('one', 'two')";
83 q.baseTableName =
"bbc"
84 q.addColumn(
null,
"name");
87 sql =
"select name from bbc limit 10 offset 20";
91 q.baseTableName =
"bbc"
92 q.addColumn(
null,
"name");
93 q.limitIsParameter =
true;
94 q.offsetIsParameter =
true;
95 sql =
"select name from bbc limit ? offset ?";
99 q.baseTableName =
"bbc"
100 q.addColumn(
null,
"name");
102 q.addSubquery(q,
null);
103 fail(
"No exception thrown");
109 return Components.results.NS_OK;
114 return Cc[
"@songbirdnest.com/Songbird/SQLBuilder/Select;1"]
115 .createInstance(
Ci.sbISQLSelectBuilder);
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Test file.