-->

How to implement database connection parameters va

2019-04-12 12:13发布

问题:

I have a case where I get X rows of database names as parameter which I need to connect to. I've succesfully made the job and transformations to repeat a table input step for each database name given as parameter. So this all works nicely when those dbnames happen to be valid. But if one of those names is invalid (db does not exist with given name), then the table input step fails with an error and the whole job stops instead of continuing for the rest of the names that are valid.

So I'm wondering is there a way to validate whether database connection parameters are valid or not? And maybe skip the step when an invalid database parameters are found?

回答1:

Parameterize the database name for your connection, then use a Check DB Connections job entry to test the the connection. I would imagine that this would require a chain of 2 transformations and 1 job:

  1. A transformation which retrieves the databases and use a Job Executor to launch a validation job with each database name passed as a parameter.
  2. A validation job checks the connection with a Check DB Connections entry and, if successful, starts a new transformation, continuing to pass the database name
  3. Final transformation with a Table Input using the parameterized connection

Maybe look into this answer for help using variables in DB connections.

Good luck!