In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
What is OQL in iTop? Today, what the editor shares with you is a detailed introduction of OQL in iTop. I believe most people don't know much about it. In order to make you understand better, the editor summarized the following content for you. Without saying much, let's move on.
ITop's OQL (object query language) supports only one type, the query statement, which is the Select statement in the SQL query. OQL is used for filtering or querying, and can be used in iTop for mail notifications, audit rules, and so on. The return value of OQL is limited to an object or a set of iTop objects. ITop eventually translates OQL into the corresponding SQL Select statement, so you can think of OQL as a subset of SQL Select, which is not as flexible as SQL statements, but is sufficient to handle various operations in iTop. Note that SQL reserved words in OQL must be uppercase and syntax case-sensitive, so the case of each object must be accurate.
The OQL syntax format is very simple, in the following form
SELECT [output_specification FROM] class_reference [class_joined] [WHERE expression] [UNION oql_query]
The parameters are explained as follows
1. [output_specification FROM]. This is optional and is needed only when multiple objects or aliases are used.
Such as:
SELECT p1 FROM Person as p1, where p1 is an alias for Person.
Or something like this:
SELECT p1,t1 FROM Person JOIN lnkPersonToTeam AS t1 ON t1.person_id=p1.id
2. Class_reference, the object name of the query, such as Person in the example above. When not using an alias, you can directly get the data in the following form
> SELECT Person, iTop automatically fetches data from the Person object table
If the iTop object name or alias to be used conflicts with the SQL reserved word, the object name or alias must be wrapped in ``. Such as
SELECT `Union`.
3. [class_joined], as in the example above, describe other objects that need to be associated. This is equal to the JOIN of the SQL statement. The specific format is JOIN object2 ON object1.attribute1 [operator] object2.attirbute1, where the operator is as follows
=, BELOW, BELOW STRICT, ABOVE or ABOVE STRICT.
Several operators related to BELOW and ABOVE are used when object 1 and object 2 have a dependency. Such as services and sub-services in iTop.
4. [WHERE expression], the same function as the WHERE statement of SQL. The syntax and functions supported by expression are described below.
5. [UNION oql_query], the same function as the UNION statement of SQL. Oql_query as long as it conforms to the OQL syntax. But the object returned by the OQL here should be consistent with the subject sentence.
WHERE expression syntax
WHERE expression can be composed of several parts, namely, string, operator, function, and finally form a Boolean result value to achieve data filtering. This is consistent with the function of SQL's WHERE clause.
The operator table is as follows
OperatorDescriptionANDLogical ANDORLogical OR/Division operator=Equality operator > = Greater than or equal operator > Greater than operator
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.