Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a python script that does the following on multiple tables

  • maketableView - not shown in code
  • Addjoin
  • Copyrows
  • MakeTableView

it was working ok, until all of a sudden it stopped.

Heres part of my code

gp.copyrows_management("HDATA_L_LICENCE_view", myTempWorkspace + os.sep + "HDATA_L_LICENCE_0")
gp.maketableview_management(myTempWorkspace + os.sep + "HDATA_L_LICENCE_0","HDATA_L_LICENCE_0_view")

gp.copyrows_management("HDATA_L_LICENCE_0_view", myTempWorkspace + os.sep + "HDATA_L_LICENCE_1")
gp.maketableview_management(myTempWorkspace + os.sep + "HDATA_L_LICENCE_1","HDATA_L_LICENCE_1_view")

**gp.copyrows_management("HDATA_L_LICENCE_1_view", myTempWorkspace + os.sep + "HDATA_L_LICENCE_2")**
gp.maketableview_management(myTempWorkspace + os.sep + "HDATA_L_LICENCE_2","HDATA_L_LICENCE_2_view")

The first two blocks work, but when the code tries to run on the line

    gp.copyrows_management("HDATA_L_LICENCE_1_view", myTempWorkspace + os.sep + "HDATA_L_LICENCE_2")

I get the following error

    Error in creating output D:\ScheduledTasks\Temp\TempWorkspace_HyMS_Licences.gdb\HDATA_L_LICENCE_2
The name of the Field is invalid: valid names may contain letters, numbers or underscores.
The table was not found. [HDATA_L_LICENCE_2]
The table was not found. [GDB_Locators]
Failed to execute (CopyRows).

Has anyone got any ideas, as I've looked at the code for a few hours but i cant seem to figure out why it is not working.... and my head hurts :(


share|improve this question
Have you checked into the "Field name is invalid" error that it is telling you about? – Chad Cooper May 14 '12 at 15:43
Just a guess - Try changing "HDATA_L_LICENCE_2" to "HDATA_L_LICENCE_2x" so that it doesn't end with a number. – Brent Edwards May 14 '12 at 16:01
up vote 4 down vote accepted

Seems like the field "HDATA_L_LICENCE_0_HDATA_L_LICENCE_REGSITE" is too long.

  • Names are limited to 32 characters.

The database and schema names do not count toward your 32 characters. So in the examples above, you could have 32 characters to the right of the second dot (.). Although names of this length are allowed, they are not recommended. As you can see in the field names section of Defining fields in tables, certain column names have the database, schema, and table names appended to them. If your table name alone was 32 characters, these column names would be unmanageably long.

share|improve this answer
This was the problem, I changed the table names so they are shorter and it works perfectly. Thanks!! – MapMan May 16 '12 at 10:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.