Using a special character to match one or more characters in a QBE string
Table 3-8 lists characters that have special meanings in a string in a QBE expression.
Table 3-9 provides examples of QBE expressions that use the preceding special and literal characters.
Matching character sets and spaces with the percent sign
The percent sign (%) matches any set of characters or blank characters. Deployment Kit adds a percent sign to a string supplied as a QBE expression when all the following conditions are true:
*
*
*
Deployment Kit adds a percent sign to ensure blank characters at the end of strings in the database do not interfere with the matching process. If you do not want Deployment Kit to add the percent sign (%) to the end of a string, enclose the string in single quotation marks in the QBE expression.
Table 3-10 shows the results of the application adding a percent sign to QBE expressions.
To match values ending in a space character when the QBE expression contains a percent character, append a percent character to the QBE expression. For example:
Sm%th%
The above syntax is valid for a QBE expression with only a single value. Deployment Kit does not add a percent sign to an expression for a range of values. For example, if the database column custName is a string and the report user types D as the value of the ad hoc parameter, the query retrieves the data row that contains Design Boards.
If the user types a range of values, such as A-D, for the ad hoc parameter value, Deployment Kit does not match customer records where custName is Design Boards. This is because the value is a range and not a single value. For example, QBE expression values that retrieve values starting with A through D appear in Table 3-11, including one to which Deployment Kit adds a percent sign.
custName LIKE 'A%' OR
custName LIKE 'B%' OR
custName LIKE 'C%' OR
custName LIKE 'D%'
Matching character sets with brackets
Brackets ([ and ]) specify a set of matching characters. Deployment Kit manages any special characters enclosed by brackets as literal characters. For example, the following QBE expression encloses the percent sign (%) and uses it literally:
ab[%]c

Additional Links:

Copyright Actuate Corporation 2012