<?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: SelctbyAttributes in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765034#M509</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the error message and the fact that you are using some enterprise geodatabase, I would start by dropping the double quotes around your field names:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;'FIPS2 = 3 OR FIPS2 = 12'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 May 2020 20:21:12 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2020-05-11T20:21:12Z</dc:date>
    <item>
      <title>SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765031#M506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where am I going wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;countiesFeatureClass &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:/ArcGISProjects/CountySelection/adminjk_NWTL@Rack30.sde/Counties_1_Dissolved"&lt;/SPAN&gt;

queryCounties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;countiesFeatureClass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                                        &lt;SPAN class="string token"&gt;'NEW_SELECTION'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                                        &lt;SPAN class="string token"&gt;'"FIPS2"=3 OR "FIPS2"=12'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Write the selected features to a new featureclass&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryCounties&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'countiesSelected'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "E:\ArcGISProjects\CountySelection\Python\Update_v4.py", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt; '"FIPS2"=3 OR "FIPS2"=12')&lt;BR /&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 7744, in SelectLayerByAttribute&lt;BR /&gt; raise e&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;The value cannot be a feature class&lt;BR /&gt;ERROR 000840: The value is not a Raster Layer.&lt;BR /&gt;ERROR 000840: The value is not a Mosaic Layer.&lt;BR /&gt;Failed to execute (SelectLayerByAttribute).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:29:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765031#M506</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-12T08:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765032#M507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying this as well...same similar error...seems to be in the syntax of the where clause...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# DEFINE THE COUNTIES FC&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"E:/Projects/County/xxxx.sde/Counties"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"counties_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# SELECT FROM BUFFER PUT INTO RESULTS VARIABLE&lt;/SPAN&gt;
results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'counties_lyr'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NEW_SELECTION'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'FIPS2 &amp;gt; 16'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# GET THE FIPS CODES FROM THE RESULTS OF THE SELECTION&lt;/SPAN&gt;
rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FIPS2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;  
    neighborVal &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIPS2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;neighborVal&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765032#M507</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-12T08:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765033#M508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note this is a Feature Class in n SDE SQL db&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;# DEFINE THE COUNTIES FC

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeFeatureLayer_management&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"E:/Projects/County/xxxx.sde/Counties"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"counties_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SelectLayerByLocation_management&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"counties_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
                                         &lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
                                         &lt;SPAN class="string token"&gt;"[FURST_JURI]='ACCOMACK'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ive tried this for Text field&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"[FURST_JURI]='ACCOMACK' "&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"FIRST_JURI = 'ACCOMACK' "&lt;/P&gt;&lt;P&gt;' "FIRST_JURI" = 'ACCOMACK' "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ive tried for Int&lt;/P&gt;&lt;P&gt;"FIPS2 &amp;gt; 1"&lt;/P&gt;&lt;P&gt;' "FIPS2" &amp;gt; 1'&lt;/P&gt;&lt;P&gt;"[FIPS2] &amp;gt; 1"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the attributes and values exist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="118" src="https://community.esri.com/legacyfs/online/491786_pastedImage_1.png" width="343" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765033#M508</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-12T08:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765034#M509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the error message and the fact that you are using some enterprise geodatabase, I would start by dropping the double quotes around your field names:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;'FIPS2 = 3 OR FIPS2 = 12'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 20:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765034#M509</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-05-11T20:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765035#M510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;results = arcpy.SelectLayerByLocation_management("counties_lyr", "NEW_SELECTION", 'FIPS2 = 3 OR FIPS2 = 12')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/491787_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 20:24:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765035#M510</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2020-05-11T20:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765036#M511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh,&amp;nbsp; you should be using Select Layer By Attribute and not Select Layer by Location.&amp;nbsp; You are passing the syntax for one into the other.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 20:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765036#M511</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-05-11T20:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765037#M512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For crying out loud....ahhahahahha...&lt;/P&gt;&lt;P&gt;Thats what you get from copy and paste form other Python scripts...ahahah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS for the extra set of eyes.....thats embarrassing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 20:34:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765037#M512</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2020-05-11T20:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: SelctbyAttributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765038#M513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No worries, it happens to all of us from time to time.&amp;nbsp; Your original code snippet was Select Layer By Attribute, but then you switched to calling Select Layer By Location in follow-up troubleshooting.&amp;nbsp; For certain data sources, putting a field name in double quotes implicitly tells ArcGIS that you are looking for a raster data set, which I think is the cause of your initial error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 21:13:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/selctbyattributes/m-p/765038#M513</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-05-11T21:13:12Z</dc:date>
    </item>
  </channel>
</rss>

