<?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 Using Variables retrieved from a cursor or list in the where clause for SelectLayerByAttribute python 3 in Telecommunications Questions</title>
    <link>https://community.esri.com/t5/telecommunications-questions/using-variables-retrieved-from-a-cursor-or-list-in/m-p/305928#M184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that takes an excel, imports it as a table then runs a query to get the needed rows and exports them to a new table.&amp;nbsp; After that a search cursor runs through the table and creates a list of values.&amp;nbsp; It then loops through the list&amp;nbsp;of values and uses the values as an input for the Where Clause for select by attribute to select the correct polygon.&amp;nbsp; That permit polygon is then used to select poles from another feature class and then export those poles as a new feature class&amp;nbsp;named by the value used to select the permit polygon.&amp;nbsp; The problem is passing the value from the list of values into the where clause of the&amp;nbsp;SelectLayerByAttribute_management tool.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;datetime

&lt;SPAN style="color: #808080;"&gt;# Variables
&lt;/SPAN&gt;time = datetime.date.today()
raw = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\MRE_Table.xlsx"
&lt;/SPAN&gt;mre_table = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\MRE_Tb"
&lt;/SPAN&gt;permits = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\Permits"
&lt;/SPAN&gt;Poles = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\Poles"
&lt;/SPAN&gt;work_table = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\MRE_workTB"
&lt;/SPAN&gt;geoDB = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;
&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb"
&lt;/SPAN&gt;arcpy.env.overwriteOutput = &lt;SPAN style="color: #cc7832;"&gt;True
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Creating Table: " &lt;/SPAN&gt;+ mre_table)
    arcpy.ExcelToTable_conversion(raw&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;mre_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Sheet1"&lt;/SPAN&gt;)

    mre_tview = arcpy.MakeTableView_management(mre_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"MRE_TableView"&lt;/SPAN&gt;)
    arcpy.SelectLayerByAttribute_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Ticket_Number IS NOT NULL"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
    arcpy.SelectLayerByAttribute_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"REMOVE_FROM_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Permit_Name = ' '"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
    arcpy.CopyRows_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;work_table)

    permitview = arcpy.MakeFeatureLayer_management(permits&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Permits_Layer"&lt;/SPAN&gt;)
    poleview = arcpy.MakeFeatureLayer_management(Poles&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Poles_Layer"&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;#   Creating a list of permit names to pass into the select by attributes for the permit grids
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;AllValues = []
    &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(work_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Permit_Name"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Ticket_Number"&lt;/SPAN&gt;)) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;search:
        &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;search:
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;] &lt;SPAN style="color: #cc7832;"&gt;not in &lt;/SPAN&gt;AllValues:
                AllValues.append(row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])

&lt;SPAN style="color: #808080;"&gt;#   looping through the list and selecting a polygon then using that polygon to select poles located within and exporting those poles into individual feature Classes
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;Value &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;AllValues:
        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(Value)
        itsa = &lt;SPAN style="color: #6a8759;"&gt;"permit_name = {}"&lt;/SPAN&gt;.format(Value)
        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(itsa)
        expression = &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(itsa)
        permitSelect = arcpy.SelectLayerByAttribute_management(permitview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;expression&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
        permitPoly = arcpy.MakeFeatureLayer_management(permitSelect&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"permitPoly_" &lt;/SPAN&gt;+ Value)
        poleSelect = arcpy.SelectLayerByLocation_management(poleview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;permitPoly&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"30 FEET"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;""&lt;/SPAN&gt;)
        arcpy.CopyFeatures_management(poleSelect&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;geoDB + &lt;SPAN style="color: #6a8759;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;" &lt;/SPAN&gt;+ Value)


&lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;Exception &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;e:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"ERROR: " &lt;/SPAN&gt;+ e.args[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])&lt;/PRE&gt;&lt;P&gt;The error that I am receiving is:&lt;/P&gt;&lt;P&gt;ERROR: ERROR 000358: Invalid expression&lt;BR /&gt;Failed to execute (SelectLayerByAttribute).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:38:39 GMT</pubDate>
    <dc:creator>BryceBarth</dc:creator>
    <dc:date>2021-12-11T14:38:39Z</dc:date>
    <item>
      <title>Using Variables retrieved from a cursor or list in the where clause for SelectLayerByAttribute python 3</title>
      <link>https://community.esri.com/t5/telecommunications-questions/using-variables-retrieved-from-a-cursor-or-list-in/m-p/305928#M184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that takes an excel, imports it as a table then runs a query to get the needed rows and exports them to a new table.&amp;nbsp; After that a search cursor runs through the table and creates a list of values.&amp;nbsp; It then loops through the list&amp;nbsp;of values and uses the values as an input for the Where Clause for select by attribute to select the correct polygon.&amp;nbsp; That permit polygon is then used to select poles from another feature class and then export those poles as a new feature class&amp;nbsp;named by the value used to select the permit polygon.&amp;nbsp; The problem is passing the value from the list of values into the where clause of the&amp;nbsp;SelectLayerByAttribute_management tool.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;datetime

&lt;SPAN style="color: #808080;"&gt;# Variables
&lt;/SPAN&gt;time = datetime.date.today()
raw = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\MRE_Table.xlsx"
&lt;/SPAN&gt;mre_table = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\MRE_Tb"
&lt;/SPAN&gt;permits = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\Permits"
&lt;/SPAN&gt;Poles = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\Poles"
&lt;/SPAN&gt;work_table = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb\MRE_workTB"
&lt;/SPAN&gt;geoDB = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;
&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\BB0322\Desktop\Projects\MRE_Coversheet\KC\KC_MRE.gdb"
&lt;/SPAN&gt;arcpy.env.overwriteOutput = &lt;SPAN style="color: #cc7832;"&gt;True
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Creating Table: " &lt;/SPAN&gt;+ mre_table)
    arcpy.ExcelToTable_conversion(raw&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;mre_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Sheet1"&lt;/SPAN&gt;)

    mre_tview = arcpy.MakeTableView_management(mre_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"MRE_TableView"&lt;/SPAN&gt;)
    arcpy.SelectLayerByAttribute_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Ticket_Number IS NOT NULL"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
    arcpy.SelectLayerByAttribute_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"REMOVE_FROM_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Permit_Name = ' '"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
    arcpy.CopyRows_management(mre_tview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;work_table)

    permitview = arcpy.MakeFeatureLayer_management(permits&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Permits_Layer"&lt;/SPAN&gt;)
    poleview = arcpy.MakeFeatureLayer_management(Poles&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Poles_Layer"&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;#   Creating a list of permit names to pass into the select by attributes for the permit grids
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;AllValues = []
    &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(work_table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Permit_Name"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Ticket_Number"&lt;/SPAN&gt;)) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;search:
        &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;search:
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;] &lt;SPAN style="color: #cc7832;"&gt;not in &lt;/SPAN&gt;AllValues:
                AllValues.append(row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])

&lt;SPAN style="color: #808080;"&gt;#   looping through the list and selecting a polygon then using that polygon to select poles located within and exporting those poles into individual feature Classes
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;Value &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;AllValues:
        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(Value)
        itsa = &lt;SPAN style="color: #6a8759;"&gt;"permit_name = {}"&lt;/SPAN&gt;.format(Value)
        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(itsa)
        expression = &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(itsa)
        permitSelect = arcpy.SelectLayerByAttribute_management(permitview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;expression&lt;SPAN style="color: #cc7832;"&gt;, None&lt;/SPAN&gt;)
        permitPoly = arcpy.MakeFeatureLayer_management(permitSelect&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"permitPoly_" &lt;/SPAN&gt;+ Value)
        poleSelect = arcpy.SelectLayerByLocation_management(poleview&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;permitPoly&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"30 FEET"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;""&lt;/SPAN&gt;)
        arcpy.CopyFeatures_management(poleSelect&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;geoDB + &lt;SPAN style="color: #6a8759;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;" &lt;/SPAN&gt;+ Value)


&lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;Exception &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;e:
    &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"ERROR: " &lt;/SPAN&gt;+ e.args[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])&lt;/PRE&gt;&lt;P&gt;The error that I am receiving is:&lt;/P&gt;&lt;P&gt;ERROR: ERROR 000358: Invalid expression&lt;BR /&gt;Failed to execute (SelectLayerByAttribute).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/telecommunications-questions/using-variables-retrieved-from-a-cursor-or-list-in/m-p/305928#M184</guid>
      <dc:creator>BryceBarth</dc:creator>
      <dc:date>2021-12-11T14:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variables retrieved from a cursor or list in the where clause for SelectLayerByAttribute python 3</title>
      <link>https://community.esri.com/t5/telecommunications-questions/using-variables-retrieved-from-a-cursor-or-list-in/m-p/305929#M185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at:&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9.0pt;"&gt;itsa = &lt;SPAN style="color: #6a8759;"&gt;"permit_name = {}"&lt;/SPAN&gt;.format(Value)&lt;/PRE&gt;&lt;P&gt;What data type is Value?&amp;nbsp; If string, you need to put quotes around it in the SQL:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;itsa &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"permit_name = '{}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Value&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 21:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/telecommunications-questions/using-variables-retrieved-from-a-cursor-or-list-in/m-p/305929#M185</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-08-02T21:15:31Z</dc:date>
    </item>
  </channel>
</rss>

