<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to verify that a Query's where statement is valid in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306640#M28147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you stuck with just using the ESRI REST API, can you create your own validate service and call that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Feb 2013 01:44:26 GMT</pubDate>
    <dc:creator>HaroldBostic</dc:creator>
    <dc:date>2013-02-22T01:44:26Z</dc:date>
    <item>
      <title>How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306639#M28146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What are the best options to check whether a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Query/where"&gt;query's where&lt;/A&gt;&lt;SPAN&gt; statement is valid?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some ideas are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- use regex or otherwise write a function to manually validate the SQL. A drawback is that the syntax of the query.where statement may be Esri-specific (eg % vs * depending on the dataset type, etc). Also, this will not verify that the statement will actually work - it may be valid SQL but not applicable to this layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- run the query, and use the execute statement's &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#QueryTask/execute"&gt;error callback&lt;/A&gt;&lt;SPAN&gt;. The problem is that you won't know until afterwards whether it was a valid statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- use &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#QueryTask/executeForIds"&gt;executeForIds&lt;/A&gt;&lt;SPAN&gt; and specify a known ID in conjunction with the error callback. The problem is that I won't know a valid ID at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- use &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#QueryTask/executeForCount"&gt;executeForCount&lt;/A&gt;&lt;SPAN&gt; to return the number of records. The problem is that for a large dataset, the executeForCount still has to find all resulting features, which can take a while.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be nice to have another option (eg QueryTask.validate) on the QueryTask, to verify that the query.where statement is valid. Another approach could be for Esri to add an option on executeForCount to break after the first feature is found (rather than waiting until all features have been found).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 02:46:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306639#M28146</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2013-02-21T02:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306640#M28147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you stuck with just using the ESRI REST API, can you create your own validate service and call that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 01:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306640#M28147</guid>
      <dc:creator>HaroldBostic</dc:creator>
      <dc:date>2013-02-22T01:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306641#M28148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Are you stuck with just using the ESRI REST API, can you create your own validate service and call that.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Harold,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you aware of any examples of this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 01:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306641#M28148</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2013-02-22T01:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306642#M28149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am afraid not.&amp;nbsp; Are you looking to return true for valid SQL or looking for true when you have Valid SQL and a result can be returned?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 02:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306642#M28149</guid>
      <dc:creator>HaroldBostic</dc:creator>
      <dc:date>2013-02-22T02:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306643#M28150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like something along the lines of the Verify option in ArcMap's Select By Attributes dialog:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22065[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This validates the statement before attempting to execute it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 02:21:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306643#M28150</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2013-02-22T02:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify that a Query's where statement is valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306644#M28151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I still don't have a concrete example but a jumping off point would be to create a gp service that accepts your query then do something similar to this in your script &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000057000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000057000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But instead of committing, just return true or false and possibly the error message if it was an invalid query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a resource for gp services &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/An_overview_of_geoprocessing_with_ArcGIS_Server/002v00000001000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/An_overview_of_geoprocessing_with_ArcGIS_Server/002v00000001000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 03:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-verify-that-a-query-s-where-statement-is/m-p/306644#M28151</guid>
      <dc:creator>HaroldBostic</dc:creator>
      <dc:date>2013-02-22T03:16:50Z</dc:date>
    </item>
  </channel>
</rss>

