Skip to main content
Question

Unable to set dynamic Table name on postgis writer


gattogis
Contributor
Forum|alt.badge.img+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

nielsgerrits
VIP
Forum|alt.badge.img+55

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.

gattogis
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 15, 2023
nielsgerrits wrote:

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


nielsgerrits
VIP
Forum|alt.badge.img+55
gattogis wrote:

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.


gattogis
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 15, 2023

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

 

image.png


gattogis
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 15, 2023

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


nielsgerrits
VIP
Forum|alt.badge.img+55
gattogis wrote:

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.


nielsgerrits
VIP
Forum|alt.badge.img+55
gattogis wrote:

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.


gattogis
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 18, 2023
gattogis wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings