<?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 Error using select and copyfeatures from SDE to personal geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672892#M52050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 000210: Cannot create output WAT_ControlValve&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Select)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same thing happens when I try using copy features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to copy a selection from the SDE to a new personal geodatabase I created if there is a selection. I didn't include all the code but wtrue is a list of layers I want to check to copy over. I have checked and the script correctly creates the pgdb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a projection issue or some other environment setting problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
if extype == "Personal Geodatabase":
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CreatePersonalGDB(outfolder,gdbname)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.WorkSpace = outfolder + os.sep + gdbname
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(gp.Workspace)
elif extype == "Shapefiles":
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Workspace = outfolder

for layer in wtrue:
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.makefeaturelayer(layer,"layer")
&amp;nbsp;&amp;nbsp;&amp;nbsp; selcount = int(gp.GetCount_management("layer").getoutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; totcount = int(gp.GetCount_management(gp.describe("layer").catalogpath).getoutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; if totcount &amp;lt;&amp;gt; selcount:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(layer + " has " + str(selcount) + " features selected")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.select("layer",layer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(layer + " has no selection")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2012 15:09:59 GMT</pubDate>
    <dc:creator>JeremyLuymes</dc:creator>
    <dc:date>2012-08-29T15:09:59Z</dc:date>
    <item>
      <title>Error using select and copyfeatures from SDE to personal geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672892#M52050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 000210: Cannot create output WAT_ControlValve&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Select)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same thing happens when I try using copy features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to copy a selection from the SDE to a new personal geodatabase I created if there is a selection. I didn't include all the code but wtrue is a list of layers I want to check to copy over. I have checked and the script correctly creates the pgdb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a projection issue or some other environment setting problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
if extype == "Personal Geodatabase":
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CreatePersonalGDB(outfolder,gdbname)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.WorkSpace = outfolder + os.sep + gdbname
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(gp.Workspace)
elif extype == "Shapefiles":
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Workspace = outfolder

for layer in wtrue:
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.makefeaturelayer(layer,"layer")
&amp;nbsp;&amp;nbsp;&amp;nbsp; selcount = int(gp.GetCount_management("layer").getoutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; totcount = int(gp.GetCount_management(gp.describe("layer").catalogpath).getoutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; if totcount &amp;lt;&amp;gt; selcount:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(layer + " has " + str(selcount) + " features selected")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.select("layer",layer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(layer + " has no selection")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 15:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672892#M52050</guid>
      <dc:creator>JeremyLuymes</dc:creator>
      <dc:date>2012-08-29T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error using select and copyfeatures from SDE to personal geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672893#M52051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps I'm missing something, but I don't see the code you are using to actually copy features into the PGDB you create.&amp;nbsp; I see where you create the PGDB, and where you check to see if there is a selection on a given layer, but not the code that copies from one place to another.&amp;nbsp; Can you show that bit?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 15:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672893#M52051</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-08-29T15:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error using select and copyfeatures from SDE to personal geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672894#M52052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It would the gp.select line. Since I set the workspace, it should select them and copy the features into the pgdb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried gp.copyfeatures as well, and tried changing the output (ie. using the actual path to the pgdb, but I still can't get it to work)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script always fails at the select.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 16:08:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672894#M52052</guid>
      <dc:creator>JeremyLuymes</dc:creator>
      <dc:date>2012-08-29T16:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error using select and copyfeatures from SDE to personal geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672895#M52053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ah, are you at a version older than 10.0?&amp;nbsp; I'm not familiar with gp.select but is this what you are looking for?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SelectData_management (in_dataelement, out_dataelement) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;see &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Select%20Data%20(Data%20Management)"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Select%20Data%20(Data%20Management)&lt;/A&gt;&lt;SPAN&gt; for more information, but if that is the tool you are intending to use, the help says its not for use in scripting.&amp;nbsp; I honestly think this tool is only for selecting data (and within the context of modelbuilder) but it doesn't actually "do" anything with them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think what you are wanting to use in any case are the tools intended to copy things from one to another place, that could be any one of the following I think:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;FeatureclassToFeatureclass_conversion (in_Features, out_path, out_name, where_clause, field_mapping, config_keyword)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;FeatureClassToGeodatabase_conversion &amp;lt;Input_Feature_class; Input_Feature_class...&amp;gt; &amp;lt;Output_Geodatabase&amp;gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;CopyFeatures_management &amp;lt;in_features&amp;gt; &amp;lt;out_feature_class&amp;gt; {config_keyword} {spatial_grid_1} {spatial_grid_2} {spatial_grid_3}&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;The first and last of those are probably more what you are looking for rather than the 2nd which i think is dealing with feature classes on-disk rather than features in a layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 18:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-select-and-copyfeatures-from-sde-to/m-p/672895#M52053</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-08-29T18:02:36Z</dc:date>
    </item>
  </channel>
</rss>

