Question

GDB Alias with dynamic schema?

  • 6 October 2021
  • 8 replies
  • 35 views

Badge

Hi, I have a workspace that write to SDE using a dynamic schema. The schema is build from an excel sheet where I have the name of the field, the type and the alias. I manage to write to SDE with all the correct parameter:

 

attribute{0}name

attribute{0}.fme_data_type

attribute{0}.native_data_type

 

The problem is that I cannot find a way to write alias. Anyone know if this is possible within a dynamic schema?

 

thank you!


8 replies

Userlevel 6
Badge +32

From the article Working with Geodatabase Field Aliases: Altering Alias Values

 

FME is able to create attribute aliases for features read into the workspace that do not have aliases. This is possible if there is an additional attribute with the same name as the original attribute and is suffixed with "_alias". The value of that attribute will be used as the alias on table creation.

For example, there is an attribute named CentreAddress and there is another attribute named CentreAddress_alias with a value of Address. The value of CentreAddresss_alias will be used as the alias of CentreAddress (alias: Address). This only needs to occur on the first feature.

 

Not tried myself but I think this should work.

Badge

Yes that's correct and I have used it that way other times but now I am using a dynamic shema so I want to include the alias in the schema definition

Userlevel 4

The easiest way to see what FME expects, is sometimes to "reverse engineer" the schema definition from an identical reader. You can e.g. do this using a FeatureReader on an existing GDB with aliases, and inspect the resulting schema features, which should show you what the corresponding writer expects.

Badge

The easiest way to see what FME expects, is sometimes to "reverse engineer" the schema definition from an identical reader. You can e.g. do this using a FeatureReader on an existing GDB with aliases, and inspect the resulting schema features, which should show you what the corresponding writer expects.

Hi David, I tried that and the only three attributes that are included in the shema definition are name, native_data_type and fme_data_type. The alias is exposed in the feature.

 

Featureschema

Badge

Hi again, I solved this by sending a feature with all the alias to the writer. I now have another issue when writing to sde. When I set native_data_type to "integer" FME writes the attribute as text and not as defiuned in the schema. Anyone know how to solve this?

Userlevel 2
Badge +10

Hi again, I solved this by sending a feature with all the alias to the writer. I now have another issue when writing to sde. When I set native_data_type to "integer" FME writes the attribute as text and not as defiuned in the schema. Anyone know how to solve this?

Hi @francescodb​, it sounds like this is something that shouldn't be happening if you've defined it as an integer in the schema. Would you be able to share a screenshot of your settings and the resulting attribute?

Badge

Hi @francescodb​, it sounds like this is something that shouldn't be happening if you've defined it as an integer in the schema. Would you be able to share a screenshot of your settings and the resulting attribute?

Hi @danminneyatsaf​ after a lot of trying I actually managed to get it right! I changed the fme_data_type from fme_int64 to fme_int32 and stopped using the native_data_type and the schema has been created with the right data type!

Hi @francescodb​, it sounds like this is something that shouldn't be happening if you've defined it as an integer in the schema. Would you be able to share a screenshot of your settings and the resulting attribute?

 

@francescodb​ 

Is it possible to share the workspace , If possible

 

Thanks

Reply