Skip to main content
Best Answer

Dynamically set Database Connection based on published parameters

  • October 3, 2019
  • 1 reply
  • 114 views

I am looking for a way to change the server to which my SQLCreators and FeatureWriters are pointed to based on a parameter. I am not seeing a clear way to do this in FME. It is my understanding that in FME, we can use Python to dynamically set parameters or update transformers.

 

What is the preferred way to do this? Can I update the Server property of a Database connection? Or should I change the connection property of the writers and creators?

Best answer by daveatsafe

Hi @alexcls,

Please create an FME Database Connection (Tools - FME Options - Database Connections) for each of the servers you want to read/write to in those transformers.

In the SQLCreator transformer, click on the triangle button beside the Connection parameter, then choose User Parameter - Create User Parameter from the dropdown menu. Click OK to accept the User Parameter settings.

You now have the ability to choose the desired server by setting the newly created parameter to the appropriate Database Connection for that server. This process will work for the FeatureWriter as well.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • October 3, 2019

Hi @alexcls,

Please create an FME Database Connection (Tools - FME Options - Database Connections) for each of the servers you want to read/write to in those transformers.

In the SQLCreator transformer, click on the triangle button beside the Connection parameter, then choose User Parameter - Create User Parameter from the dropdown menu. Click OK to accept the User Parameter settings.

You now have the ability to choose the desired server by setting the newly created parameter to the appropriate Database Connection for that server. This process will work for the FeatureWriter as well.