English

Error: ORA-00904: invalid column name

Error Message

shp2sde command may generate the following error:

"SDE Code (-51): Underlying DBMS error Extended DBMS error code: 904 ORA-00904: invalid column name"

Cause

When using shp2sde with the -a option to include all attributes or specific fields from the attribute table, shp2sde creates an Oracle table from the attributes of the shapefile.

Oracle table and column names follow these rules:
1 to 30 characters.
Cannot contain quotation marks.
Cannot be an Oracle reserved word.
Must begin with a letter.
Can contain only A-Z, 0-9, $, #, and _.

If the attribute table associated with the shapefile has field names that violate Oracle's rules for naming tables or columns, the error is returned upon executing shp2sde.

Solution or Workaround

The -a option can be used to specify a filename in the form -a file=<file_name> that maps the column(s) from the shapefile to the new database columns of the business (attribute) table.

The file should follow the format:

name                  country_name
abbrevname abbreviation
fips_code fips
wb_cntry cntry_code


In this example, only the columns named on the left would be imported from the shapefile into the resulting ArcSDE business (attribute) table. The items on the right would be used as the new column names in the ArcSDE business table. For example, the first column fips_code in the shapefile attribute table is renamed to fips when converted to ArcSDE.