Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.AddJoin_management("HDATA_L_LICENCE_view", "HIRE_COMPANY", "HDATA_L_HIRE_COMPANY_view", "HIRE_COMPANY", "KEEP_COMMON")
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.AddJoin_management("HDATA_L_LICENCE_0_view", "HDATA_L_LICENCE_LICENCE_TYPE", "HDATA_L_LICENCE_TYPE_view", "LICENCE_TYPE", "KEEP_COMMON")
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.AddJoin_management("HDATA_L_LICENCE_1_view", "HDATA_L_LICENCE_0_HDATA_L_LICENCE_REGSITE", "GAZETTEER_layer", "NSG_REF", "KEEP_COMMON")
**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 :(

Thanks

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
add comment

1 Answer 1

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.

http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#geodatabases/defining_tables.htm

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

Your Answer

 
discard

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.