Query operators

Since Service Manager must translate queries into native RDBMS language, you should try to use operators that map well to native RDBMS languages. In general, queries that use the EQUAL TO operator ( = ) are the most efficient and easiest to translate.

Operator Example query Sample SQL statement
EQUAL TO ( =) contact.name="AARON, JIM" SELECT "CONTACT_NAME" FROM CONTCTSM1 WHERE "CONTACT_NAME"='AARON, JIM';

As the example illustrates, an EQUAL TO query often directly translates into a SQL query as part of a WHERE clause. In addition, queries with EQUAL TO operations are also the most likely to use and benefit from table indexes.

If you cannot use an EQUAL TO operator in a query, the following operators will also in many cases facilitate direct translation into SQL queries.

Operator Example query Sample SQL statement
Starts with
( # )
contact.name#"AA" SELECT "CONTACT_NAME" FROM CONTCTSM1 WHERE "CONTACT_NAME" LIKE 'AA%';
LIKE contact.name like "A*RON*" SELECT "CONTACT_NAME" FROM CONTCTSM1 WHERE "CONTACT_NAME" LIKE 'A%RON%';
ISIN contact.name isin {"AARON, JIM","ARMSTRONG, TRACY"} SELECT "CONTACT_NAME" FROM CONTCTSM1 WHERE "CONTACT_NAME" IN ('AARON,JIM','ARMSTRONG,TRACY');

In these examples, the LIKE operator directly translates into a SQL query as part of a WHERE clause. The ISIN operator translates into an IN predicate. The STARTS WITH operator ( # ) translates into a LIKE predicate using a wildcard character.

Such kind of queries now translate into a SQL statement like the following:

'1 in assets="adv-Unix-101"'

'a3.record_number = 1 AND a3.asset = ?'

Supported query operators

The following operators are supported in a query:

  • All logical operators
  • TR, and NTR
  • Like

Caution If other operators are used in a query, the query translates into "1=1" and may cause performance issues.

For example, the following queries are supported:

'1 in assets ="adv-Unix-101"'

'7 in assets >"adv-Unix-101"'

'7 in assets#"adv-Desktop"'

'7 in assets like "adv-*-104"'

Caution Only one array member can be used in the same query. For example, the following query is not supported:

1 in assets ="adv-Unix-101" and 2 in assets ="adv-Unix-102"

This is because in the final SQL statement there would be "a3.record_number = 1 AND a3.record_number = 2", which is always false for the RDBMS.