Skip to main content
Question

Database connections retrieve parameters programmatically

  • March 27, 2019
  • 7 replies
  • 216 views

giosp
Contributor
Forum|alt.badge.img+7

Hi,

I'm thinking if use database connections are better than published parameters or privates one and use it in embed connections. Database connections are usefull in case of maintenance, but I think are less usable as embed parameters.

The main question is about accessing database connection parameters from other transformers or from attributes (programmatically i.e. python). I'd like to use the host parameter set in database connection parameter for setting other variables and have a dynamic workbench in function of the host value.

With classical embed parameters is easy but with embed connections I think that is not possible.

I hope my question is clear.

Thank you for any suggestions about it.

Regards

Giosia

 

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.

7 replies

Forum|alt.badge.img+2

@giosp Just to clarify your question. When you create a database or web connection you can choose between:

- Embed Connection Parameters

- Add Database Connection...

as shown below.

If you embed connection parameters, you can publish any of the connection parameters as a public or private parameters:

If you add a database connection, then the only parameter you can publish is the connection name.

If you embed your connection parameters, you should be able to publish the Host name and use that published parameter in a scripted parameter or other readers and transformers.


giosp
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • April 1, 2019

Hi @markatsafe,

sorry for my mistake... I've made confusion about embed connection parameters and database connections (fme desktop/server)... I was speaking about database connection and not about embed connection parameter. I've corrected my post. Embed connection parameters were for me embedded in fme desktop (sotred in the application)... Unhappy word to describe variables.

 

So the correct answer is that database connection are simply linked with a parameter and I can read the name as string format. With this I'm happy because I can understand if I'm in test or in production.

It could be fine to have the possibility to access to parameters as in example:

myconnectionName.host
myconnectionName.port

I use host information for establish a connection in other part of the workbench as SystemCaller Transformer.

Thank you

giosia


Forum|alt.badge.img+2

@giosp Thanks for the clarification. I have made this an Idea so other users can add their comments. Please vote and add any additional comments.


Forum|alt.badge.img+2

Hi @markatsafe,

sorry for my mistake... I've made confusion about embed connection parameters and database connections (fme desktop/server)... I was speaking about database connection and not about embed connection parameter. I've corrected my post. Embed connection parameters were for me embedded in fme desktop (sotred in the application)... Unhappy word to describe variables.

 

So the correct answer is that database connection are simply linked with a parameter and I can read the name as string format. With this I'm happy because I can understand if I'm in test or in production.

It could be fine to have the possibility to access to parameters as in example:

myconnectionName.host
myconnectionName.port

I use host information for establish a connection in other part of the workbench as SystemCaller Transformer.

Thank you

giosia

@giosp Thanks for the clarification. I have made this an Idea so other users can add their comments. Please vote and add any additional comments.


giosp
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • April 1, 2019

Thank you.


  • May 17, 2019

I also tried to create a new reader using embed connection parameters for db connections. It doesn't allow me to use any published or private parameters to set up the connection host/username/password. Below is my screenshot and I am using the MacOS version:


andreaatsafe
Safer
Forum|alt.badge.img+15

I also tried to create a new reader using embed connection parameters for db connections. It doesn't allow me to use any published or private parameters to set up the connection host/username/password. Below is my screenshot and I am using the MacOS version:

Hi @wechin,

 

You'll first need to create the embedded connection and have a reader added to your workspace.

 

Then you can edit the reader and be able to create parameters for the host/username/password etc.