import WhereClause from "@arcgis/core/core/sql/WhereClause.js";
            const WhereClause = await $arcgis.import("@arcgis/core/core/sql/WhereClause.js");
            @arcgis/core/core/sql/WhereClause
        The WhereClause is used to extract the features that meet a specified condition by parsing the provided results in to a value. The sql.parseWhereClause() method returns a Promise that resolves to an instance of this module.
Property Overview
| Name | Type | Summary | Object | 
|---|---|---|---|
An array of the field names used in the where clause.  | WhereClause | ||
Returns   | WhereClause | ||
A parse tree is a data structure for representing a parsed sql statement.  | WhereClause | 
Property Details
- 
  
    
An array of the field names used in the where clause. It can be used to get the appropriate fields when querying layers.
Example// parse layer's definition expression into where clause object sql.parseWhereClause(layer.definitionExpression, layer.fieldsIndex) .then(function(clause){ layer.queryFeatures({ where: "1=1", // where clause object returns layer fields // use these fields to query features from the layer outFields: clause.fieldsNames }).then(function(results) { // process query results }); }); 
- 
  
  
isStandardized
PropertyisStandardized Booleanreadonly - 
  
    
Returns
trueif the parsed where clause meets the requirements of standardized sql. 
- 
  
  
parseTree
PropertyparseTree SQLNodeSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, parseTree added at 4.24.  - 
  
    
A parse tree is a data structure for representing a parsed sql statement. Parsing a statement requires the grammar of the language that the statement was written.
 
Method Overview
| Name | Return Type | Summary | Object | 
|---|---|---|---|
Executes the where clause against a feature to generate a value.  | WhereClause | ||
Tests the attributes of a feature against the   | WhereClause | 
Method Details
- 
  
  
calculateValue
MethodcalculateValue(feature){Object} - 
  
  
    
Executes the where clause against a feature to generate a value. It is used when the
WhereClauseis being used as a simple expression. For example, you can use the expression to gather values for statistics.Parameterfeature ObjectThe feature to check against the where clause.
ReturnsType Description Object Returns a value after check feature against the provided where clause. Returns nullif the provided value is unknown.Example// calculate the grand total sales price of all features featureLayer.queryFeatures().then(function(results){ let total; const expression = "totalSales * totalPrice"; sql.parseWhereClause(expression, layer.fieldsIndex) .then(function(whereClause){ // check if the where clause meets requirements of standardized sql if (whereClause.isStandardized){ features.forEach(function(feature){ total += whereClause.calculateValue(feature) }); console.log(total); // prints the total sales price of all features } }); }); 
- 
  
  
testFeature
MethodtestFeature(feature){Boolean} - 
  
  
    
Tests the attributes of a feature against the
whereClause, and returnstrueif the test passes,falseotherwise.Parameterfeature ObjectThe feature to test against the
whereClause.ReturnsType Description Boolean Returns trueif the test passes,falseotherwise.Examplesql.parseWhereClause("POPULATION > 100000", layer.fieldsIndex) .then(function(clause){ let testResult = clause.testFeature(new Graphic({ attributes: { POPULATION: 300000 } }); console.log(testResult); // prints true }); 
Type Definitions
- 
  
  
BinaryNode
Type DefinitionBinaryNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, BinaryNode added at 4.24.  - 
  
    
A binary expression node. It is an operator that defines the way two expressions are combined to yield a single result. It can be an arithmetic operator, the assignment operator (=), a comparison operator (>=), a logical operator (AND), or a string concatenation operator (+).
- Properties
 - 
  type String
The value is always "binary-expression".
location SQLSourceLocationoperator String|"||"Defines the way two expressions are combined to yield a single result.
Possible Values:"AND"|"OR"|"IS"|"ISNOT"|"IN"|"NOT IN"|"BETWEEN"|"NOTBETWEEN"|"LIKE"|"NOT LIKE"|"<>"|"<"|">"|">="|"<="|"="|"*"|"-"|"+"|"/"
left SQLNodeSQL node to the left of the binary node.
right SQLNodeSQL node to the right of the binary node.
optionalescape StringEscape string.
 
 
- 
  
  
BoolNode
Type DefinitionBoolNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, BoolNode added at 4.24.  - 
  
    
A node that contains a boolean expression. Used for expressing a condition or criterion which can be either true or false.
- Properties
 - 
  type String
The value is always "boolean".
location SQLSourceLocationvalue BooleanValues are
trueorfalse. 
 
- 
  
  
ColumnNode
Type DefinitionColumnNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, ColumnNode added at 4.24.  - 
  
    
A node that contains column name of a layer or table.
- Properties
 - 
  type String
The value is always "column-reference".
location SQLSourceLocationcolumn StringColumn or field name.
 
 
- 
  
  
CurrentTimeNode
Type DefinitionCurrentTimeNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, CurrentTimeNode added at 4.24.  - 
  
    
A node that contains
CURRENT_TIMESTAMP,CURRENT_TIME, orCURRENT_DATEfunctions.- Properties
 - 
  type String
The value is always "current-time".
location SQLSourceLocationmode StringThe current time node mode.
Possible Values:"timestamp"|"date"|"time"
 
 
- 
  
  
CurrentUserNode
Type DefinitionCurrentUserNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.31WhereClause since 4.14, CurrentUserNode added at 4.31.  - 
  
    
A node that contains
CURRENT_USERfunction.- Properties
 - 
  type String
The value is always "current-user".
location SQLSourceLocation 
 
- 
  
  
DataTypeNode
Type DefinitionDataTypeNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.26WhereClause since 4.14, DataTypeNode added at 4.26.  - 
  
  
  
- Properties
 - 
  type String
The value is always "data-type".
location SQLSourceLocationvalue Object 
 
- 
  
  
DateNode
Type DefinitionDateNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, DateNode added at 4.24.  - 
  
    
A node that contains date.
- Properties
 - 
  type String
The value is always "date".
location SQLSourceLocationvalue StringThe date value.
 
 
- 
  
  
FunctionNode
Type DefinitionFunctionNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, FunctionNode added at 4.24.  - 
  
    
A nodes that contains SQL function.
- Properties
 - 
  type String
The value is always "function".
location SQLSourceLocationname StringName of the SQL function.
args ListNodeFunction arguments.
 
 
- 
  
  
IntervalNode
Type DefinitionIntervalNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, IntervalNode added at 4.24.  - 
  
    
Interval node indicates that the character literal is an interval. An interval is defined as the difference between two dates and times.
- Properties
 - 
  type String
The value is always "interval".
location SQLSourceLocationvalue StringNode|ParamNodeInterval node value.
op StringInterval node sign.
Possible Values:"+"|"-"|""
qualifier IntervalQualifierNode|IntervalPeriodNodeThe interval qualifier can either be a single datetime field or be composed of two datetime fields, in the form:
<leading field> TO <trailing field>. 
 
- 
  
  
IntervalPeriodNode
Type DefinitionIntervalPeriodNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, IntervalPeriodNode added at 4.24.  - 
  
    
Interval period node.
- Properties
 - 
  type String
The value is always "interval-period".
location SQLSourceLocationperiod StringInterval node periods.
Possible Values:"day"|"month"|"hour"|"second"|"year"|"minute"
Precision for an interval data type includes interval leading precision, interval precision, and seconds precision.
Seconds precision.
 
 
- 
  
  
IntervalQualifierNode
Type DefinitionIntervalQualifierNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, IntervalQualifierNode added at 4.24.  - 
  
    
Node that contains interval qualifier. The interval qualifier can either be a single datetime field or be composed of two datetime fields, in the form:
<leading field> TO <trailing field>.- Properties
 - 
  type String
The value is always "interval-qualifier".
location SQLSourceLocationstart IntervalPeriodNode 
 
- 
  
  
ListNode
Type DefinitionListNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, ListNode added at 4.24.  - 
  
    
A node that contains a list.
- Properties
 - 
  type String
The value is always "expression-list".
location SQLSourceLocationSQL expressions for the list.
 
 
- 
  
  
NullNode
Type DefinitionNullNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, NullNode added at 4.24.  - 
  
    
A node that contains
NULLvalue.- Properties
 - 
  type String
The value is always "null".
location SQLSourceLocationvalue nullNull value.
 
 
- 
  
  
NumberNode
Type DefinitionNumberNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, NumberNode added at 4.24.  - 
  
    
A node that contains number.
- Properties
 - 
  type String
The value is always "number".
location SQLSourceLocationvalue NumberNumeric value.
 
 
- 
  
  
ParamNode
Type DefinitionParamNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, ParamNode added at 4.24.  - 
  
    
ParamNode.
- Properties
 - 
  type String
The value is always "parameter".
location SQLSourceLocationvalue String 
 
- 
  
  
SQLNode
Type DefinitionSQLNode BinaryNode |BoolNode |ColumnNode |CurrentTimeNode |CurrentUserNode |DataTypeNode |DateNode |FunctionNode |IntervalNode |IntervalPeriodNode |IntervalQualifierNode |ListNode |NullNode |NumberNode |ParamNode |SearchedCaseNode |SimpleCaseNode |StringNode |TimeNode |TimeStampNode |UnaryNode |WhenNodeSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, SQLNode added at 4.24.  - 
  
    
SQL parse tree is composed of SqlNodes. It may be an operator, literal, function, list, and so forth.
 
- 
  
  
SQLSourceLocation
Type DefinitionSQLSourceLocation Object - 
  
  
  
- Properties
 - 
  start SQLSourcePosition
 
 
- 
  
  
SQLSourcePosition
Type DefinitionSQLSourcePosition Object 
- 
  
  
SQLSyntaxError
Type DefinitionSQLSyntaxError Object - 
  
  
  
- Properties
 - 
  name String
The value is always "SyntaxError".
location SQLSourceLocationmessage String 
 
- 
  
  
SearchedCaseNode
Type DefinitionSearchedCaseNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, SearchedCaseNode added at 4.24.  - 
  
    
Node that contains case expression.
- Properties
 - 
  type String
The value is always "case-expression".
location SQLSourceLocationformat StringCase expression format. Value for this property is always
searched.The value is always "searched".
When clauses.
Else SQL node.
optionalelseLocation SQLSourceLocation|null|undefined 
 
- 
  
  
SimpleCaseNode
Type DefinitionSimpleCaseNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, SimpleCaseNode added at 4.24.  - 
  
    
Simple case expression node. Case expressions provide a decoding capability that allows one expression to be transformed into another. Case expressions can appear anywhere that other forms of expressions can be used.
 
- 
  
  
StringNode
Type DefinitionStringNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, StringNode added at 4.24.  - 
  
    
A node that contains string.
- Properties
 - 
  type String
The value is always "string".
location SQLSourceLocationvalue StringThe string value.
 
 
- 
  
  
TimeNode
Type DefinitionTimeNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, TimeNode added at 4.24.  - 
  
    
A node that contains time.
- Properties
 - 
  type String
The value is always "time".
location SQLSourceLocationvalue StringThe time value.
 
 
- 
  
  
TimeStampNode
Type DefinitionTimeStampNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, TimeStampNode added at 4.24.  - 
  
    
A node that contains date.
- Properties
 - 
  type String
The value is always "timestamp".
location SQLSourceLocationvalue StringString date value.
 
 
- 
  
  
UnaryNode
Type DefinitionUnaryNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, UnaryNode added at 4.24.  - 
  
    
A node that contains unary operator. Unary operators can be applied only to expressions that evaluate to any one of the data types of the numeric data type category.
- Properties
 - 
  type String
The value is always "unary-expression".
location SQLSourceLocationoperator StringThe value is always "NOT".
expr SQLNodeThe sql node.
 
 
- 
  
  
WhenNode
Type DefinitionWhenNode ObjectSince: ArcGIS Maps SDK for JavaScript 4.24WhereClause since 4.14, WhenNode added at 4.24.  - 
  
    
Node that contains when clause.
- Properties
 - 
  type String
The value is always "when-clause".
location SQLSourceLocationoperand SQLNodeoperand.
value SQLNodevalue.