1 karl 1.7 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 karl 1.5 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.4 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.5 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.6 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.7 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.3 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.2 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
|
21 kumpf 1.3 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 kumpf 1.3 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 // Author: Mike Brasher (mbrasher@bmc.com)
33 //
34 // Modified By:
35 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38 #ifndef Pegasus_WQLOperation_h
39 #define Pegasus_WQLOperation_h
40
41 #include <Pegasus/Common/Config.h>
42 #include <Pegasus/WQL/Linkage.h>
43
44 PEGASUS_NAMESPACE_BEGIN
45
46 /** Represents SQL where clause operators.
47
48 mike 1.2 These operators include the following:
49
50 <ul>
51 <li>OR</li>
52 <li>AND</li>
53 <li>NOT</li>
54 <li>=</li>
55 <li><></li>
56 <li><</li>
57 <li>≤</li>
58 <li>></li>
59 <li>≥</li>
60 <li>IS NULL</li>
61 <li>IS NOT NULL</li>
62 <li>IS TRUE</li>
63 <li>IS NOT TRUE</li>
64 <li>IS FALSE</li>
65 <li>IS NOT FALSE</li>
66 </ul>
67
68 Here's an example of a SQL query that uses some of these operations.
69 mike 1.2
70 <pre>
71 SELECT *
72 FROM MyClass
73 WHERE (x > 10 OR y ≤ 1.5) OR z = 19 AND name IS NOT NULL
74 </pre>
75
76 As the parser recognizes these operations, it adds the corresponding
77 WQLOperation enumeration tag to the WQLSelectStatement by calling
78 WQLSelectStatement::appendOperation().
79
80 Operators may be converted to string by calling WQLOperationToString().
81
82 Note that in expressions like this one:
83
84 <pre>
85 count IS TRUE
86 </pre>
87
88 The IS operator is NOT treated as a binary operator (which would take
89 count and TRUE as its operands). Instead, the IS operator and TRUE operand
90 mike 1.2 are combined to form a single unary operation called "IS_TRUE". In this
91 way, evaluation may be implemented by more efficiently (the TRUE operand
92 is eliminated and therefore need not be handled). Conceptually, the above
93 expression is equivalent to the following psuedo expression:
94
95 <pre>
96 IS_TRUE(count)
97 </pre>
98
99 Note that this technique is applied the following operations (also
100 combined to be unary operations).
101
102 <ul>
103 <li>WQL_IS_NULL</li>
104 <li>WQL_IS_NOT_NULL</li>
105 <li>WQL_IS_TRUE</li>
106 <li>WQL_IS_NOT_TRUE</li>
107 <li>WQL_IS_FALSE</li>
108 <li>WQL_IS_NOT_FALSE</li>
109 </ul>
110 */
111 mike 1.2 enum WQLOperation
112 {
113 WQL_OR,
114 WQL_AND,
115 WQL_NOT,
116 WQL_EQ,
117 WQL_NE,
118 WQL_LT,
119 WQL_LE,
120 WQL_GT,
121 WQL_GE,
122 WQL_IS_NULL,
123 WQL_IS_NOT_NULL,
124 WQL_IS_TRUE,
125 WQL_IS_NOT_TRUE,
126 WQL_IS_FALSE,
127 WQL_IS_NOT_FALSE
128 };
129
130 PEGASUS_WQL_LINKAGE const char* WQLOperationToString(WQLOperation x);
131
132 mike 1.2 PEGASUS_NAMESPACE_END
133
134 #endif /* Pegasus_WQLOperation_h */
|