<?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 Merging all tables in a File Geodatabase in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427584#M14375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model that creates multiple tables in a file geodatabase that are the results of an OD cost matrix. I need to merge all of the tables in to one. I want to be able to do this automatically as the number of tables and their names will change. How can I add all of the tables into the Merge Tool automatically? I would like to stay in the model environment as I am not very experienced in python. Any ideas on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jun 2012 20:34:34 GMT</pubDate>
    <dc:creator>BradShore1</dc:creator>
    <dc:date>2012-06-15T20:34:34Z</dc:date>
    <item>
      <title>Merging all tables in a File Geodatabase</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427584#M14375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a model that creates multiple tables in a file geodatabase that are the results of an OD cost matrix. I need to merge all of the tables in to one. I want to be able to do this automatically as the number of tables and their names will change. How can I add all of the tables into the Merge Tool automatically? I would like to stay in the model environment as I am not very experienced in python. Any ideas on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 20:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427584#M14375</guid>
      <dc:creator>BradShore1</dc:creator>
      <dc:date>2012-06-15T20:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Merging all tables in a File Geodatabase</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427585#M14376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you iterating this model? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please can you share a snapshot?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you try using the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000050000000"&gt;Append&lt;/A&gt;&lt;SPAN&gt; tool to merge all the tables into a target dataset (yes, u will have to create a target dataset with the schema of all possible fields that your tables could contain). Read tool help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 21:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427585#M14376</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-06-15T21:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Merging all tables in a File Geodatabase</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427586#M14377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for you reply. There is an Iterator in a nested model that performs the OD Cost Matrix. I tried using Collect Values to add the tables created from the copy rows within the Iterator as the input for the Merge. The Merge Tool shows the Tables I want to Merge in the Input Dataset section, and shows the fields in the Field Map section, but the Merge fails with: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-ERROR 000622: Failed to execute (Merge). Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-ERROR 000734: Inputs Datasets: 'all Tables created by Copy Rows(5 of them)'&amp;nbsp; does not exist or is not supported. Failed to execute (Merge). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Tables do exsist and the paths to them are shown correct in the Merge's Input Dataset section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the same errors with the Append Tool. All 5 Tables I want to Merge are from the Lines of the OD Cost Matrix and all have the same fields. All 5 exsist in the same GDB and are the only things in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]15300[/ATTACH][ATTACH=CONFIG]15301[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 17:20:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427586#M14377</guid>
      <dc:creator>BradShore1</dc:creator>
      <dc:date>2012-06-18T17:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Merging all tables in a File Geodatabase</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427587#M14378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For anyone interested, I found a script &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/11200-gp.Merge_management-using-list-in-python" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; that does what I need. I updated it to work with arcpy and added parameters to make it a script tool. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
import os.path

in_dir = arcpy.GetParameterAsText(0)
out_dir = arcpy.GetParameterAsText(1)
env.workspace = in_dir
input_tables = arcpy.ListTables()

vtab = arcpy.ValueTable()
for table in input_tables:
&amp;nbsp;&amp;nbsp;&amp;nbsp; vtab.addRow(os.path.join(in_dir, table))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
merged_table = os.path.join(out_dir)
arcpy.Merge_management(vtab, merged_table, '')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:15:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427587#M14378</guid>
      <dc:creator>BradShore1</dc:creator>
      <dc:date>2021-12-11T19:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Merging all tables in a File Geodatabase</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427588#M14379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad you found a solution, but the errors you cite sound like the problem I had with Iterate and Collect Values, which I also mentioned here: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/16478-ModelBuilder-loses-file?highlight=problems+iterate+feature+classes"&gt;http://forums.arcgis.com/threads/16478-ModelBuilder-loses-file?highlight=problems+iterate+feature+classes&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS may be deleting the last table being created during the iteration, because it considers it intermediate data.&amp;nbsp; Yet the last named output is still included in the Collect Values dataset and is passed into the next tool (Merge), which causes the tool to crash, because one element that was "collected" no longer exists.&amp;nbsp; (And even though the error description lists all of the files feeding into the Merge tool, it did the same in my case, but the only missing one was the last one, which caused the Merge to crash.&amp;nbsp; You should at least check whether this might be happening for you.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case, unchecking Intermediate for the Derived Data (your equivalent = %Name%) solved the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2012 23:44:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/merging-all-tables-in-a-file-geodatabase/m-p/427588#M14379</guid>
      <dc:creator>DavidHockman-Wert</dc:creator>
      <dc:date>2012-07-11T23:44:16Z</dc:date>
    </item>
  </channel>
</rss>

