Using ArcGIS JavaScript API 3.21 I need to grab all Points on a Server. The code works for me with Query.where
clause at
query.where = "FeederID = 'RMT001'";
but as I said I need to get all Points. I tried to run the query without any Query.where
statement but not getting back anything. can you please let me know how to get all Points?
function execute () {
var query = new Query();
query.where = "FeederID = 'RMT001'";
query.returnGeometry = true;
query.outFields = [ "CreationUser", "FName" ];
queryTask.execute(query, showResults);
}
Solved! Go to Solution.
Bengi,
Just use:
query.where = "1=1";
Is all except query expression (<>) valid in the JavaScript API. I couldn't get a result of the query.
query.where = "(NAMETEXT <> '"+valuefromcombo+"')"
I am aware it can work with successive OR statements like
query.where = "(NAMETEXT = '"+valuefromcombo+"') OR (NAMETEXT ='Havel')";
OR
query.where = "NAMETEXT in ('xxx', 'yyyy')";
Note:valuefromcombo is a user impute variable and it is text to be clear if in case there is an issue of (<>) expression with text values?
No <> is not valid SQL. You need to use NOT Instead.
query.where = "(NAMETEXT NOT LIKE 'Havel')";
Worked perfectly. Thanks Robert!!!!