<?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: variable within a whereclause in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/variable-within-a-whereclause/m-p/87083#M326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You'd just need to use string substitution. Something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;exp = '"SystemOwner" = \'{0}\''.format(variable)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2013 21:47:08 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2013-06-17T21:47:08Z</dc:date>
    <item>
      <title>variable within a whereclause</title>
      <link>https://community.esri.com/t5/transportation-questions/variable-within-a-whereclause/m-p/87082#M325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a novice with arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to use the arcpy.Select_analysis to select a featureclass with a selection based on an attibute and a txtfile. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All is working except that the where clasue does not like it when I try to install a variable.&amp;nbsp; Such as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis(fromFC, line[:-1]+"\\output_temp", exp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the FromFC is the FC I am coping from. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the line[:-1]+"\\output_temp" is the FC I am pushing the selection of the FromFC to, ans&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;exp is the expression -&amp;nbsp; exp = '"SystemOwner" = \'Rockingham\''&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rockingham is in the place I would like to put the variable as I have several towns to run through.&amp;nbsp; I am not sure of the syntax by which to add the variable, as defined in an open statement for a textfile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas or suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 21:36:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/variable-within-a-whereclause/m-p/87082#M325</guid>
      <dc:creator>JamesArmstrong</dc:creator>
      <dc:date>2013-06-17T21:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: variable within a whereclause</title>
      <link>https://community.esri.com/t5/transportation-questions/variable-within-a-whereclause/m-p/87083#M326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You'd just need to use string substitution. Something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;exp = '"SystemOwner" = \'{0}\''.format(variable)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 21:47:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/variable-within-a-whereclause/m-p/87083#M326</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-06-17T21:47:08Z</dc:date>
    </item>
  </channel>
</rss>

