<?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: Local variables in SQL statement of Python GIS in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331680#M25785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Logan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That solved.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2011 13:48:15 GMT</pubDate>
    <dc:creator>xiaojiabao</dc:creator>
    <dc:date>2011-10-28T13:48:15Z</dc:date>
    <item>
      <title>Local variables in SQL statement of Python GIS</title>
      <link>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331678#M25783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is the appropriate format to use local variables in SQL statements under python GIS?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I came across error messages when I'm running the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;bas=24&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Select(input, Output_Feature_Class, "\"BAS\"= bas")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, it is ok if I run: gp.Select(input, Output_Feature_Class, "\"BAS\"= 24")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate any potential help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 20:27:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331678#M25783</guid>
      <dc:creator>xiaojiabao</dc:creator>
      <dc:date>2011-10-27T20:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Local variables in SQL statement of Python GIS</title>
      <link>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331679#M25784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can't use local variable names directly -- you have to use &lt;/SPAN&gt;&lt;A href="http://docs.python.org/release/2.6.5/library/stdtypes.html#string-formatting-operations" rel="nofollow noopener noreferrer" target="_blank"&gt;string formatting&lt;/A&gt;&lt;SPAN&gt; or concatenation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
bas=24
whereClause = "\"BAS\"= %d" % (bas)
gp.Select(input, Output_Feature_Class, whereClause)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:42:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331679#M25784</guid>
      <dc:creator>LoganPugh</dc:creator>
      <dc:date>2021-12-11T15:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Local variables in SQL statement of Python GIS</title>
      <link>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331680#M25785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Logan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That solved.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 13:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/local-variables-in-sql-statement-of-python-gis/m-p/331680#M25785</guid>
      <dc:creator>xiaojiabao</dc:creator>
      <dc:date>2011-10-28T13:48:15Z</dc:date>
    </item>
  </channel>
</rss>

