<?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: SQL and output syntax for Extract by Attributes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/sql-and-output-syntax-for-extract-by-attributes/m-p/750307#M57932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As far as the SQL is concerned, look at the examples in the 'where clause' section &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000071000000"&gt;on this page&lt;/A&gt;&lt;SPAN&gt; (basically, enclose it in quotes in your favourite manner). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know about the workspace question, but just try it one way and if it doesn't work, try it the other (takes less time than waiting for an answer).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2012 18:20:19 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2012-04-03T18:20:19Z</dc:date>
    <item>
      <title>SQL and output syntax for Extract by Attributes</title>
      <link>https://community.esri.com/t5/python-questions/sql-and-output-syntax-for-extract-by-attributes/m-p/750306#M57931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a couple of questions related to the syntax for Extract by Attributes, related to the code block below (part of a larger script):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
for raster in arcpy.ListRasters: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpoint = workspace + raster + "af"
&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlclause = "VALUE" = 6 OR "VALUE" = 8
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.ExtractbyAttributes (raster, sqlclause)
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract.save (outpoint)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My understanding is that extract.save is the only way to save the output of Extract by Attributes. Do I need to create a full file pathname for this, or does it automatically save in the current workspace? (i.e., can I drop "workspace" from outpoint or is it understood to save within the current workspace?). Sorry if this is an obvious question, but I can't seem to find any documentation on this syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I'm copying the syntax from the online example for the SQL query, but it looks totally incorrect; does it need to be enclosed in square brackets?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 17:13:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sql-and-output-syntax-for-extract-by-attributes/m-p/750306#M57931</guid>
      <dc:creator>AnneRiddle</dc:creator>
      <dc:date>2012-04-03T17:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL and output syntax for Extract by Attributes</title>
      <link>https://community.esri.com/t5/python-questions/sql-and-output-syntax-for-extract-by-attributes/m-p/750307#M57932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As far as the SQL is concerned, look at the examples in the 'where clause' section &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000071000000"&gt;on this page&lt;/A&gt;&lt;SPAN&gt; (basically, enclose it in quotes in your favourite manner). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know about the workspace question, but just try it one way and if it doesn't work, try it the other (takes less time than waiting for an answer).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 18:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sql-and-output-syntax-for-extract-by-attributes/m-p/750307#M57932</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-04-03T18:20:19Z</dc:date>
    </item>
  </channel>
</rss>

