<?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: Create a search with user GetParameterAsText using arcpy.da.SearchCursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263540#M20332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can move your select statement before creating the search cursor. Otherwise, you execute a select statement for each feature in the cursor. The cursor only considers selected features, so you don't need to filter with a where clause. The following selection where clause is hardcoded, but you can sub that out for GetParameterAsText.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy 
... mxd = arcpy.mapping.MapDocument('CURRENT') 
... df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0] 
... lyr = arcpy.mapping.ListLayers(mxd, "bc_geoname_albers")[0] 
... whereClause = "GEONAME LIKE '%Fraser%' "
... arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", whereClause )
... with arcpy.da.SearchCursor(lyr, ["SHAPE@","GEONAME"]) as cursor: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = row[0].extent 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale = df.scale * 5 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView() &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:55:12 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T12:55:12Z</dc:date>
    <item>
      <title>Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263533#M20325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a script tool to do a search but i am having a little trouble putting it together and i am not sure if i am going about it the right way. I would like to have a script tool that can search for a subdivision name inside arcmap in the toolbox. I have attached my python code i have and working with, one other thing i would like this script to do is use a wildcard. For example say a subdivision that i am searching for attribute is "County Side Estates" but I would like to just enter "County" and select all subs with "County" but i am not sure how to accomplish this. Any help would be gratefully appreciated.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error i am getting with my current code.&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\GIS\Python Scripts\ZoomToParcelScript6Eb.py", line 9, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;&lt;P&gt;RuntimeError: Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'ACRES'.] [vector.DBO.Subdivision_boundaries]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Failed to execute (ZoomToSubScript).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
lyr = arcpy.mapping.ListLayers(mxd, "Subdivision Boundaries")[0] 

whereClause = arcpy.GetParameterAsText(0)
with arcpy.da.SearchCursor(lyr, ("PLAT_NAME"), whereClause) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_str = whereClause #= '{0}'.format(row[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", query_str) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = row[0].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale = df.scale * 5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.mapping.ExportToPDF(mxd, "C:/test/" + fc + "_" + str(row[1]) + "_" +&amp;nbsp; str(row[2]) + ".pdf") 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are my script parameters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263533#M20325</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-11T12:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263534#M20326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like your whereclause is incomplete.&amp;nbsp; Try:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt;&lt;SPAN style="color: #006699;"&gt;whereClause = &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"PLAT_NAME LIKE '%" + arcpy.GetParameterAsText(0) + "%'"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;Tom &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 16:54:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263534#M20326</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2015-05-20T16:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263535#M20327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made the following adjustments, When i type in Rolling Hills #3, i get the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\GIS\Python Scripts\ZoomToParcelScript6Eb.py", line 9, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;&lt;P&gt;RuntimeError: Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'HILLS'.] [vector.DBO.Subdivision_boundaries]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Failed to execute (ZoomToSubScript).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i type in just Rolling i get this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\GIS\Python Scripts\ZoomToParcelScript6Eb.py", line 9, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/P&gt;&lt;P&gt;RuntimeError: Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server]An expression of non-boolean type specified in a context where a condition is expected, near ')'.] [vector.DBO.Subdivision_boundaries]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Failed to execute (ZoomToSubScript).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the current code with your suggestions. i am assuming that the syntax is incorrect still.&lt;/P&gt;&lt;P&gt;I am lost...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
lyr = arcpy.mapping.ListLayers(mxd, "Subdivision Boundaries")[0] 

whereClause = arcpy.GetParameterAsText(0)
with arcpy.da.SearchCursor(lyr, ("PLAT_NAME"), whereClause) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_str = "PLAT_NAME LIKE '%" + whereClause + "%'"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", query_str) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = row[0].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale = df.scale * 5

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.mapping.ExportToPDF(mxd, "C:/test/" + fc + "_" + str(row[1]) + "_" +&amp;nbsp; str(row[2]) + ".pdf") 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263535#M20327</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-11T12:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263536#M20328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you are doing another selection which you have already done using your search cursor so that you can zoom to the extent of the plat.&amp;nbsp; There are always many ways to do things.&amp;nbsp; Here is a suggestion.&amp;nbsp; I have removed the section selection and added the shape field to your search cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy 

mxd = arcpy.mapping.MapDocument('CURRENT') 
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0] 
lyr = arcpy.mapping.ListLayers(mxd, "Subdivision Boundaries")[0] 

whereClause = "PLAT_NAME LIKE '%" + arcpy.GetParameterAsText(0) + "%'" 
with arcpy.da.SearchCursor(lyr, ("SHAPE@", "PLAT_NAME"), whereClause) as cursor: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor: 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = row[0].extent 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale = df.scale * 5 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView() 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.mapping.ExportToPDF(mxd, "C:/test/" + fc + "_" + str(row[1]) + "_" +&amp;nbsp; str(row[2]) + ".pdf")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263536#M20328</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2021-12-11T12:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263537#M20329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wasn't sure if this was the best way to do the search, if there is a better FASTER way please let me know.&lt;/P&gt;&lt;P&gt;The reason i had that the arcpy.SelectLayerByAttribute_management was to actually make the selection on the Layer, I ran the code that you posted and it took me to the area but did not highlight the sub that i searched for. Once i added the arcpy.SelectLayerByAttribute_management back it zoomed to the location and the search sub was highlighted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do noticed something strange with the zoom though, if i search by Quail it selects the subs with Quail but zooms to each one, one by one. I would like to just zoom to all of them one time. is this a function of how the arcpy.da.SearchCursor works?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 18:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263537#M20329</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2015-05-20T18:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263538#M20330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Certainly!&amp;nbsp; Here is a completely alternative way to accomplish what you are trying to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy&amp;nbsp; 
&amp;nbsp; 
mxd = arcpy.mapping.MapDocument('CURRENT')&amp;nbsp; 
df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]&amp;nbsp; 
lyr = arcpy.mapping.ListLayers(mxd, "Subdivision Boundaries")[0] 
&amp;nbsp; 
whereClause = "PLAT_NAME LIKE '%" + arcpy.GetParameterAsText(0) + "%'"
lyr.definitionQuery = whereClause
df.extent = lyr.getExtent(True)
arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263538#M20330</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2021-12-11T12:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263539#M20331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The lyr.definitionQuery worked but after running the script to search for "Quail" the features were not highlight and i noticed that when i open the Sub layer attributes only those attributes in the table, what happened to the rest of the subdivision features? How do you rest the Sub layer to show all of the subdivision in the attribute table. I would like to keep all the subdivision features and only select the features that i search for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 20:32:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263539#M20331</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2015-05-20T20:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263540#M20332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can move your select statement before creating the search cursor. Otherwise, you execute a select statement for each feature in the cursor. The cursor only considers selected features, so you don't need to filter with a where clause. The following selection where clause is hardcoded, but you can sub that out for GetParameterAsText.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy 
... mxd = arcpy.mapping.MapDocument('CURRENT') 
... df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0] 
... lyr = arcpy.mapping.ListLayers(mxd, "bc_geoname_albers")[0] 
... whereClause = "GEONAME LIKE '%Fraser%' "
... arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", whereClause )
... with arcpy.da.SearchCursor(lyr, ["SHAPE@","GEONAME"]) as cursor: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = row[0].extent 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.scale = df.scale * 5 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView() &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263540#M20332</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T12:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263541#M20333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't want to be picky, but I like to recommend using Python string formatting. MUCH easier to write and debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;search_string = arcpy.GetParameterAsText(0) 
whereClause = "GEONAME LIKE '%{}%'".format(search_string)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:55:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263541#M20333</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search with user GetParameterAsText using arcpy.da.SearchCursor</title>
      <link>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263542#M20334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done a couple of similar projects where I am doing a search like you are trying to do.&amp;nbsp; I add a second instance of the layer&amp;nbsp; to the dataframe that I want to use for the search as described above.&amp;nbsp; That way I can set the symbology and label the selected features too.&amp;nbsp; That way when a search is performed they can better see the results of their search.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, there are many ways to do things.&amp;nbsp; Use what best works for your situation!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 15:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-search-with-user-getparameterastext-using/m-p/263542#M20334</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2015-05-21T15:26:40Z</dc:date>
    </item>
  </channel>
</rss>

