Sun WBEM SDK Developer's Guide

Using the WBEM Query Language

The WBEM Query Language is a subset of standard American National Standards Institute Structured Query Language (ANSI SQL) with semantic changes to support WBEM on Solaris. Unlike SQL, in this release WQL is a retreval-only language. You cannot use WQL to modify, insert, or delete information.

SQL was written to query databases, in which data is stored in tables with a row-column structure. WQL has been adapted to query data that is stored using the CIM data model. In the CIM model, information about objects is stored in CIM classes and CIM instances. CIM instances can contain properties, which have a name, data type, and value. WQL maps the CIM object model to SQL tables.

Table 4–2 Mapping of SQL to WQL Data

SQL 

Is Represented in WQL as... 

Table 

CIM class 

Row 

CIM instance 

Column 

CIM property 

Supported WQL Key Words

The Sun WBEM SDK supports Level 1 WBEM SQL, which enables simple select operations without joins. The following table describes the WQL key words supported in the Sun WBEM SDK.

Table 4–3 Supported WQL Key Words

Key Word 

Description 

AND 

Combines two Boolean expressions and returns TRUE when both expressions are TRUE. 

FROM 

Specifies the classes that contain the properties listed in a SELECT statement. 

NOT 

Comparison operator used with NULL. 

OR 

Combines two conditions. When more than one logical operator is used in a statement, OR operators are evaluated after AND operators. 

SELECT 

Specifies the properties that will be used in a query. 

WHERE 

Narrows the scope of a query. 

WBEM Query Language Operators

The following table lists the standard WQL operators that can be used in the WHERE clause of a SELECT statement.

Table 4–4 WQL Operators

Operator 

Description 

Equal to 

Less than 

Greater than 

<= 

Less than or equal to 

>= 

Greater than or equal to 

<> 

Not equal to