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.

Here's 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 can't seem to figure out why it is not working... and my head hurts :(

  • Have you checked into the "Field name is invalid" error that it is telling you about? May 14, 2012 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. May 14, 2012 at 16:01

1 Answer 1


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.


  • This was the problem, I changed the table names so they are shorter and it works perfectly. Thanks!!
    – MapMan
    May 16, 2012 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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