Select to view content in your preferred language

Create a blank table

2251
3
11-05-2013 11:05 AM
VygintasCesnauskas
Occasional Contributor
I am looking to create a blank table in the file geodatabase, that I could then dynamically populate with fields from an SQL dataset.

Is there a basic xml definition file that I could use with geodatabase.CreateTable (String^ tableDef) to get a blank table?
0 Kudos
3 Replies
VinceAngelo
Esri Esteemed Contributor
Could you explain what you mean by "blank table"? 

The definition to a table is an object with ONE OR MORE columns, so creating a table without
any columns is clearly not possible.

- V
0 Kudos
VygintasCesnauskas
Occasional Contributor
Hi vangelo,

Apologies, I am still familiarizing myself with way file geodatabases work. By blank table I mean a table with just the ID column. In the sample code that came with the API there is this section:


 
        string featureClassDef = "";
        using (StreamReader sr = new StreamReader("../../Samples/TableSchema/Streets.xml"))
        {
          while (sr.Peek() >= 0)
          {
            featureClassDef += sr.ReadLine() + "\n";
          }
          sr.Close();
        }
        Table streetsTable = geodatabase.CreateTable(featureClassDef, "");
        Console.WriteLine("The streets table has been created.");


Basically I am looking for an xml definition similar to what's in "Streets.xml", but simplified to a bare minimum that will result in an empty single column table. I will then add any additional columns in the next stage.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I once worked to support a project that tried to follow an anti-design paradigm like this.
It failed spectacularly, with a Stop Work order after hopeless performance issues at the
first review. As expected (by everyone except the project leads), the continual table
changes fractured the contents and prevented indexes from working.

I recommend using a database design instead, or moving to an XML/NoSQL product.
Implementing a non-relational data structure in a databaseless relational engine is
not likely to bear fruit.

- V
0 Kudos