Question

Unable to set dynamic Table name on postgis writer

  • 15 December 2023
  • 8 replies
  • 11 views

Badge +1

Hi, i'm downloading a zipped shapefile from http caller (going well), saving correctly as a file, but when i try to write it to a new postgis table something goes wrong. I want to dynamically set the Table Name as "sentierisat" plus the value stored in "_timestamp" field: something like "sentierisat_@Value(_timestamp)" but what i get is actually 2 postgis tables, an empty one with the correct tablename and a second one filled with data but named only "sentierisat_".

 

Screenshot 2023-12-15 110755Screenshot 2023-12-15 122509


8 replies

Userlevel 6
Badge +33

I think you can make this work, but you need to:

  • Change the fme_feature_type_name in the schema feature to sentierisat_@Value(_timestamp). You can do this using an AttributeCreator.
  • Change the fme_feature_type in the data features to sentierisat_@Value(_timestamp).
  • Enable checkbox Dynamic Schema Definition in the writer.
Badge +1

I think you can make this work, but you need to:

  • Change the fme_feature_type_name in the schema feature to sentierisat_@Value(_timestamp). You can do this using an AttributeCreator.
  • Change the fme_feature_type in the data features to sentierisat_@Value(_timestamp).
  • Enable checkbox Dynamic Schema Definition in the writer.

Thanks, but i don't understand where to insert the AttributeCreator

Userlevel 6
Badge +33

Thanks, but i don't understand where to insert the AttributeCreator

On the connections between the FeatureReader and the Writer.

If you want to create a dynamic flow using the schema feature as you print screened, the writer used the attribute fme_feature_type_name from the schema feature and fme_feature_type from the data features to get the relation between the 2. This is why you need to change both.

Badge +1

Ok, but i don't see "fme_feature_type" in the data features

 

image.png

Badge +1

Alternatively i already have a field in my schema table called "_dirname" whose value is the same as the table name i want to obtain ("sentierisat_20231215"). How can i use this value to generate dynamic postgis table name creation?

 

image

Userlevel 6
Badge +33

Ok, but i don't see "fme_feature_type" in the data features

 

image.png

If you click the magnifier glass to inspect the feature, click the record in the table and open the "feature information" window, you can see the unexposed attributes.

Userlevel 6
Badge +33

Alternatively i already have a field in my schema table called "_dirname" whose value is the same as the table name i want to obtain ("sentierisat_20231215"). How can i use this value to generate dynamic postgis table name creation?

 

image

You can use the value from one attribute in another one, by selecting the attribute "_dirname" in the value field in the AttributeCreator.

Badge +1

Thanks, but i don't understand where to insert the AttributeCreator

I've tried multiple times, but I really can't figure out how to extract the 'fme_feature_type' attribute from the data features to apply the AttributeCreator as you suggested.

Reply