<?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: Problem with simple definition query expression in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441755#M34598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;abandoned likely... converting to discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 May 2017 01:31:34 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-05-21T01:31:34Z</dc:date>
    <item>
      <title>Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441745#M34588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to assign a value to two shapefiles in the first data frame of my .mxd with definition query, but it seems that cannot be done.&lt;/P&gt;&lt;P&gt;Any suggestion? Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"waste"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;definitionQuery &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Code = 'IT1300021'"&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:45:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441745#M34588</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2021-12-11T19:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441746#M34589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the error or what is the result?&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;lyr&lt;SPAN&gt;.&lt;/SPAN&gt;definitionQuery &lt;SPAN&gt;==&lt;/SPAN&gt; .... this is an equality check not an assignment, which is what I think you want&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 10:39:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441746#M34589</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-28T10:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441747#M34590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good note, but is not working either with that. I get an error &lt;STRONG&gt;Runtime error SyntaxError: can't assign to comparison (&amp;lt;string&amp;gt;, line 6)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441747#M34590</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2017-04-28T11:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441748#M34591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So no error? just nothing is happening?&lt;/P&gt;&lt;P&gt;It might be time to add&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;lyr&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;supports&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"DEFINITIONQUERY"&lt;/SPAN&gt;&lt;SPAN&gt;):&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;to the test to ensure your layers support a query and a couple of print statement to monitor progress, otherwise a malformed query should have at least thrown an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441748#M34591</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-28T11:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441749#M34592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ve also tried this, but didn't work also&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
aa &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'IT1300021'"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"waste"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;definitionQuery &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'Code = {}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aa&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441749#M34592</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2021-12-11T19:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441750#M34593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote that but...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
aa &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'IT1300021'"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;supports&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DEFINITIONQUERY"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"waste"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&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; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;definitionQuery &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Code = 'IT1300021'"&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441750#M34593</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2021-12-11T19:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441751#M34594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well lacking print statements, it isn't possible to see the code even gets into the sections where the definitions are being set.&amp;nbsp; I can only refer you to the help topic where it states that the source and type of the layer is important, case sensitivity applies to one type and not another and that changes are not automatic but an update may need to be made.&amp;nbsp; Hence, my recommendation about print statements to see what is going on....it is probably something obvious&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/updatingandfixingdatasources.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/updatingandfixingdatasources.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm"&gt;http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:39:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441751#M34594</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-28T11:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441752#M34595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In both of your follow-up code snippets, you are still using an equality check (&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;==&lt;/SPAN&gt;) instead of an assignment &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;(=).&amp;nbsp;&lt;/SPAN&gt; Even if all of the lines up to the final line worked, the final line of code isn't' going to update anything, it is only going to return a &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;True&lt;/SPAN&gt; or &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;False&lt;/SPAN&gt; that has no impact on anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 13:28:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441752#M34595</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-04-28T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441753#M34596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like Dan said, you should use = instead of ==.&amp;nbsp;&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="keyword token"&gt;import&lt;/SPAN&gt; arcpy
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"waste"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;definitionQuery &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Code = 'IT1300021'"&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshActiveView&lt;SPAN class="punctuation token"&gt;(&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441753#M34596</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2021-12-11T19:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441754#M34597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the status of this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 20:36:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441754#M34597</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-05-09T20:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with simple definition query expression</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441755#M34598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;abandoned likely... converting to discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 May 2017 01:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-simple-definition-query-expression/m-p/441755#M34598</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-05-21T01:31:34Z</dc:date>
    </item>
  </channel>
</rss>

