Skip to main content
Solved

Prioritize the Writing of Data to a database


Forum|alt.badge.img

Hi,

I have 3 writers (feature types), all PostgreSQL connected to the same schema but different tables. The second writer should be the first to be written, then the third and so on. This is because of the dependency of the primary key of one writer as the foreign key in the second writer.

Can we fix this writing process?

I tried the feature holder, connection runtime order, but no luck yet. Also tried the file writer, however, the required attributes are not written. Any quick solutions that I am missing out on?

 

Thanks!

Best answer by david_r

Generally speaking I would recommend using the FeatureWriter transformer to write these features.

Have you looked at this article: https://community.safe.com/s/article/working-with-foreign-keys-writing-database-tables

And perhaps also this: https://community.safe.com/s/article/write-feature-types-in-a-specific-order

FME 2021 also introduces a Group By in the FeatureWriter which will simplify this even further.

View original
Did this help you find an answer to your question?

2 replies

david_r
Evangelist
  • Best Answer
  • March 9, 2021

Generally speaking I would recommend using the FeatureWriter transformer to write these features.

Have you looked at this article: https://community.safe.com/s/article/working-with-foreign-keys-writing-database-tables

And perhaps also this: https://community.safe.com/s/article/write-feature-types-in-a-specific-order

FME 2021 also introduces a Group By in the FeatureWriter which will simplify this even further.


Forum|alt.badge.img
  • Author
  • March 11, 2021
david_r wrote:

Generally speaking I would recommend using the FeatureWriter transformer to write these features.

Have you looked at this article: https://community.safe.com/s/article/working-with-foreign-keys-writing-database-tables

And perhaps also this: https://community.safe.com/s/article/write-feature-types-in-a-specific-order

FME 2021 also introduces a Group By in the FeatureWriter which will simplify this even further.

I was using the FeatureWriter transformer to order my writing but was unclear about how to get attributes. Now, I can import the attribute values. Thanks @david_r​ 

I also discovered the 'Connection Runtime Order' for the first time.


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