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