<?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 Issue with queryTask and SQL Reserved Keywords in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-querytask-and-sql-reserved-keywords/m-p/67224#M5920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ran into an interesting issue using the queryTask and thought I would post my findings in hopes it can save someone else the coding heartache I just went through.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We pull data tables into SDE from the County's AS400.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the data tables I was performing a query on had a SQL reserved keyword used as an field name. When including the conflicting field name in the query.outFields; the query fails. This is also the case when trying to use query.outFields = ["*"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my example, the conflicting field name was ALL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using query.outFields = ["ALL"]; failed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using query.outFields = ["*"]; also failed&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not setting query.outFields to anything, works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The errors produced:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 100005: Method failed. HRESULT = 0x8004152f : This is a FACILITY_ITF error that is specific to the interface that returned this error. See the documentation of the interface that returned this error for information about this HRESULT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 10837: General GeoDatabase Error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 10837: Geodatabase error: Invalid SQL syntax [Microsoft SQL Server Native Client 10.0: Incorrect syntax near the keyword 'ALL'.] [Server.DataBase.TableName].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Solution: Do not use SQL reserved keywords for field names. Now we simply rename the field when pulling the table into SDE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Happy Debugging!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Jan 2011 14:09:35 GMT</pubDate>
    <dc:creator>Kathleen_Crombez</dc:creator>
    <dc:date>2011-01-23T14:09:35Z</dc:date>
    <item>
      <title>Issue with queryTask and SQL Reserved Keywords</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-querytask-and-sql-reserved-keywords/m-p/67224#M5920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ran into an interesting issue using the queryTask and thought I would post my findings in hopes it can save someone else the coding heartache I just went through.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We pull data tables into SDE from the County's AS400.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the data tables I was performing a query on had a SQL reserved keyword used as an field name. When including the conflicting field name in the query.outFields; the query fails. This is also the case when trying to use query.outFields = ["*"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my example, the conflicting field name was ALL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using query.outFields = ["ALL"]; failed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using query.outFields = ["*"]; also failed&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not setting query.outFields to anything, works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The errors produced:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 100005: Method failed. HRESULT = 0x8004152f : This is a FACILITY_ITF error that is specific to the interface that returned this error. See the documentation of the interface that returned this error for information about this HRESULT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 10837: General GeoDatabase Error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code 10837: Geodatabase error: Invalid SQL syntax [Microsoft SQL Server Native Client 10.0: Incorrect syntax near the keyword 'ALL'.] [Server.DataBase.TableName].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Solution: Do not use SQL reserved keywords for field names. Now we simply rename the field when pulling the table into SDE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Happy Debugging!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Jan 2011 14:09:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-querytask-and-sql-reserved-keywords/m-p/67224#M5920</guid>
      <dc:creator>Kathleen_Crombez</dc:creator>
      <dc:date>2011-01-23T14:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with queryTask and SQL Reserved Keywords</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-querytask-and-sql-reserved-keywords/m-p/67225#M5921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got the same HRESULT error (0x8004152f) when using the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;It starts with this statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string strQuery = "PL_PMAP == '" + txtTile.Text + "'";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;which is then passed in as one of the parameters in the following statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clsQuery.QueryPoly("Match Sheet", strQuery, txtTile.Text, featureSelection, 2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;and here is the recipient class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class clsQuery&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static IQueryFilter queryFilter = new QueryFilterClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void QueryPoly(string dataFrame, string query, string tileNum, IFeatureSelection featureSelection, Int32 index)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryFilter.WhereClause = query;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The query is "PL_PMAP = '555'".&amp;nbsp; Everything about these statements look right -- the correct feature class is selected; it contains a string field called PL_PMAP; and, '555' is an actual value in that field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't understand your statement about looking in the interface (IFeatureSelection?) to discover the cause of this error.&amp;nbsp; The limited amount of additional information about the error is also vague, although I suspect a permissions issue (???)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any light you can throw on this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2011 22:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-querytask-and-sql-reserved-keywords/m-p/67225#M5921</guid>
      <dc:creator>CharlesShore</dc:creator>
      <dc:date>2011-09-26T22:09:42Z</dc:date>
    </item>
  </channel>
</rss>

