Friday, 25 August 2017

arcpy - Projecting features to Enterprise Geodatabase in Oracle gives ERROR 000210: Cannot create output



I am trying to project features from a geodatabase and write into an enterprise geodatabase connection. I have permissions to create data and the name I am using also works, but I keep getting error:



ERROR 000210: Cannot create output



It is being loaded in sde:oracle11g database. I am facing issues with only point feature classes


Field names


Field names


My code:


in_dataset = r'R:\50_Scratch\4AnnaArora\MigrationProject\test\test_data.gdb\Test'
out_dataset = r'R:\50_Scratch\4AnnaArora\MigrationProject\test.sde\WS_Test'

out_coor_system= 4326
sr = arcpy.Describe(in_dataset).spatialReference
arcpy.Project_management(in_dataset, out_dataset,out_coor_system, sr)

Answer



The 000210 error is principally caused by two potential errors:




  • The table name is not valid (often a reserved word)





  • One or more of the columns are not valid (reserved word or too many characters)




The ArcSDE communication library has constants which limit table and column name buffers to 32 bytes (31 characters, plus a closing terminator).


Oracle itself has naming limits of 30 characters for table and column names (it is now possible to exceed these, but ArcGIS doesn't use the additional syntax to support this, so the limit exists).


The reason you can load a shapefile is that the dBase III+ format used by Esri for shapefile attributes has a 10-character column name limitation, which truncates the actual name (which may be hidden by the "Alias" property in the metadata). When you source from file geodatabase (which has a 64-codepoint column name limitation) the full name is submitted for Oracle table creation, and the SQL fails.


The solution is to truncate the column names to 30 characters (though the alias can be wider). I try not to exceed 24 characters, just for sanity in display width, and then I don't need to worry about hitting hard database limits.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...