Advanced Customization > Windchill Adapter > Using Windchill Adapter Webjects > Specifying the TYPE and WHERE Parameters > Valid Syntax for WHERE Parameters
  
Valid Syntax for WHERE Parameters
An acceptable value of the WHERE parameter is a query expression. A valid query expression contains one ore more query terms:
A term specifies an attribute name, a relational operator, and a value or wildcard pattern.
A negation operator might preface a term to request that an inverse database matching operation be applied.
Terms can be connected by boolean operators to produce conjunctive (AND) and disjunctive (OR) expressions.
Sub-expressions can be enclosed by parenthesis to control order of execution.
The following grammar defines the valid syntax for WHERE parameters:
Quoted strings define terminal symbols (literal character sequences that must occur in a valid WHERE value).
A name enclosed by "<" and ">" is a non-terminal symbol.
A sequence enclosed by "(" and ")*" indicates that zero or more occurrences are accepted.
Alternative productions for a non-terminal are delimited by the vertical line character "|".
<expression> ::= <subexpr>
| "()"
<subexpr> ::= <term> (<boolean> <subexpr>)*
<term> ::= <name> <relational> <value>
| "!" <term>
| "(" <expression> ")"
<boolean> ::= "&" | "|"
<relational> ::= "=" | "!=" | "<" | "<=" | ">" | ">="
<name> ::= attribute-name
<value> ::= <quoted> | <unquoted>
<quoted> ::= "' " <unquoted-value> "' "
<unquoted> ::= <exact> | <wildcard>
<wildcard> ::= <wild_char> (<wildcard>)*
<wild_char> ::= "*" | character
Where:
attribute-name—An acceptable value is the internal name for any attribute of the business object type specified by the TYPE parameter.
The internal name of a hard (modeled) attribute is simply the name of the attribute.
The internal name of a soft attribute is assigned in the Type and Attribute Management utility.
These internal names can be overridden in <Windchill>/codebase/LogicalAttributes.xml.
"()"—The special expression "()" generates a query that returns all business objects of the type specified by the TYPE parameter.
This should be used with caution as it might return a very large number of business objects. Other expressions generate queries that return the business object, if any, that match the indicated criteria. In addition, webjects accept multiple WHERE parameter values. In this case, the multiple values are concatenated with the & operator to form the query expression that will be executed.
boolean—The boolean operator & is the AND operator, and the boolean operator | is the OR operator.
When both are specified in an expression, "&" has higher precedence than "|", so the sub-expressions connected by "&" are executed first. However, parenthesized expressions are always executed before any other part of the expression as a whole, so parenthesis can be used to override the default precedence rules.
Nested parenthesized expressions are executed from the deepest to the most shallow. If using a JSP page, an AND can be represented in the WHERE clause as &. If using XML tasks, the AND must be specified using the HTML encoded value for &, which is &amp.
value—An acceptable attribute value is any value or wildcard string that is valid for the attribute.
* 
Wildcards only work for those attributes whose type is a string. When pre-processing a where clause, the value portion of a name=value pair is translated to the type for the corresponding attribute. As a result, wildcards only work for string attributes.
For example, assume you have an attribute named “count” and it is an integer. A where clause containing “count=1” is valid because 1 can be translated into an integer. However, “count=1*” is not valid because “1*” cannot be translated into an integer.
If you would like to specify numeric ranges, use the > < operators.