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.

Second title: "Is arcpy.ValidateTableName broken on Oracle?"

I have an Oracle SDE database 9.3.1 (service connection). My arcGIS client tools are version 10.0 SP5). I have some names of feature classes(fc) that I would like create.

I want to make sure that the name of the feature class is valid before I create it so I use the arcpy.ValidaTableName function.

However when I try to validate a long fc I do NOT get a valid table name for Oracle (Oracle has a table identifier character limit on 30).

import arcpy
oracleWorkspace = "F:\shr016\all_is_sde_databases\esri_mogpros_5167_gisowner.sde"

print arcpy.ValidateTableName("very_long_table_name_with_too_many_characters_for_an_oracle_database", oracleWorkspace)

# prints: very_long_table_name_with_too_many_characters_for_an_oracle_database

Is there way I can validate table names on SDE with a Oracle backend?

Update

It seems like this feature is indeed not working correctly.

Esri support writes in an email:

I have tested with arcpy.ValidateTableName with an Oracle database and it does behave as you have mentioned in your previous email. Currently, I am not aware of any alternate way of checking if the feature class name is valid from the Oracle side. I will be investigating this issue further and will update you with my findings.

Update 2

Esri support has followed up:

This tool was designed to check for naming conventions, i.e. presence of any invalid characters or use of any reserverd keywords specific to the RDBMS being used. For checking the character length, I am contemplating logging an enhancement request. In the meantime you could include something like the following in your script to make sure the table name does not exceed 30 characters:

import string, os

test = "tableName"
oracleWorkspace = "F:\shr016\all_is_sde_databases\esri_mogpros_5167_gisowner.sde"

if len(test) <=30:
  print arcpy.ValidateTableName(test, oracleWorkspace) 
else:
   print "Invalid table name"

Conclusion:

If you need a function that returns a valid table name for an Oracle SDE table name you have to write it yourself.

Update 3

A final update from esri support which confirms the conclusion:

I have logged an enhancement request for this incident: NIM090928-arcpy.ValidateTableName should check that table names do not exceed the workspace's maximum number of characters.

share|improve this question
    
I've always found backward compatibity (Newer version of ArcGIS Desktop connecting to older SDE) to be flaky. Maybe that is the cause? –  Devdatta Tengshe Apr 17 '13 at 5:41
    
@DevdattaTengshe I have tried with arcsde 10.0 connection with the same result, so the backwards compatibility is not the problem. (not the only problem at least.) –  steenhulthin Apr 18 '13 at 14:41
add comment

1 Answer

up vote 5 down vote accepted

It looks like you are hitting a known issue.

NIM034235 IFieldChecker.ValidateTableName should check that table names do not exceed the workspace's maximum number of characters.

mackayj80 describes the issue in this Esri blog post.

share|improve this answer
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.