One Star

context parameters for db connections

hidy
is it possible to define DB connection settings in the metadata so that each table schema would have context.parm-type values in connection setting.
Example:
I have two connections, database_stage and database_DW.
Whenever i drag and drop a table schema to the job design (as input or output), I would love if the host, port etc. settings were populated with values such as context.DW_HOST, context.DW_PORT for the DW connection and context.STAGE_HOST and context.STAGE_PORT for the stage connection.
Is this possible?
Thanks in advance
7 REPLIES
Five Stars

Re: context parameters for db connections

create two context in context group, like stage and DW. and create same number and same name variables in each context, then assign different values to these variables. whenever you required to change connection just change the context.
One Star

Re: context parameters for db connections

create two context in context group, like stage and DW. and create same number and same name variables in each context, then assign different values to these variables. whenever you required to change connection just change the context.

Thanks, this I believe is what I've done. Where / how do I place the variables so that I don't have to manually re-enter them into my new inputs / outputs?
Five Stars

Re: context parameters for db connections

all the text fields are configurable so you can create a respective variables and put it in respective text boxes. like below.
One Star

Re: context parameters for db connections

In your example, do you need to change the connection details to "client inventory details" whenever you create a new instance of the schema, or are the values prepopulated?
In the attached picture I'm trying to set the connection details as context parameters for a new database connection. I was wishing this way all the table schemas under that connection would automatically get the context parameters as connection information. It doesn't work though - contexts aren't allowed here apparently.
Community Manager

Re: context parameters for db connections

Whenever i drag and drop a table schema to the job design (as input or output), I would love if the host, port etc. settings were populated with values such as context.DW_HOST, context.DW_PORT for the DW connection and context.STAGE_HOST and context.STAGE_PORT for the stage connection.
Is this possible?
Thanks in advance

Yes, the db connection parameters are set as context variables. see my screenshots.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: context parameters for db connections

Whenever i drag and drop a table schema to the job design (as input or output), I would love if the host, port etc. settings were populated with values such as context.DW_HOST, context.DW_PORT for the DW connection and context.STAGE_HOST and context.STAGE_PORT for the stage connection.
Is this possible?
Thanks in advance

Yes, the db connection parameters are set as context variables. see my screenshots.
Shong
That looks exactly like what I'm looking for.
Where did you specify the database connection to use those context variables for all its' schema?
I'm assuming you did not modify the parameters only for "person" input, but on more generic level so that if you were to include another input or output from the same DB connection, you're get the same connection values there, too?
Thanks
Community Manager

Re: context parameters for db connections

Hi drmartin
Not sure I understand you well, you need to retrieve the table schema first under DB connection in repository, then drag and drop the table schema from repository to job design, select the input/output component, all the db connection parameters are there with repository type, you don't need to set them manually.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business