Solved

Dynamically set Database Connection based on published parameters

  • 3 October 2019
  • 1 reply
  • 31 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?

icon

Best answer by daveatsafe 3 October 2019, 19:05

View original

1 reply

Userlevel 2
Badge +17

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.

Reply