Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Papademuchos
Creator
Creator

Continue Job Iterations after SQL Connection Failure

I'd like to iterate through several databases and run a query to collect certain values. My problem is that the user account I'm using doesn't have access / permission to all of the databases on my list. Here's my steps:

Query 1: Retrieve a list of values from a common table. This list includes the server name and the database name.

FlowToIterate: I want to iterate through each of the records returned and run a query

Query 2: Using the current iteration, query a table and retrieve a value.

Problem: Some of the databases on returned from Query 1 are not accessible for the user account. Talend stops with a SQLException (cannot open database).

Question: How do I ignore this and continue to the next iteration? I've tried several components (tDBConnection, tDBInput, tDBRow...) They all cause the job to stop immediately. I've tried "OnComponentError" hoping it would execute that branch and then continue, but it doesn't.

I'm looking for some way to test the connection without failing the job.

Any ideas or work-arounds are appreciated!

Labels (2)
6 Replies
Anonymous
Not applicable

Hi

Do you want to catch the exception information and log them to somewhere? or don't need the logs, just want to ignore the exception and continue to iterate next record?

Regards

Shong

Oliemar84
Contributor
Contributor

You could setup Docker and run your own set of DB's from there.

Or use the fixedflowinput insteadof DB's you don't have access to and mimick the values which you need.

Papademuchos
Creator
Creator
Author

Both would be good, but primarily to ignore the exception and continue iterating to the next record.

Papademuchos
Creator
Creator
Author

Thanks, but I don't have the option of setting up different databases. FixedFlowInput doesn't really work in this scenario - I need to read a value from client databases, which will vary from client to client.

Anonymous
Not applicable

@Torry Slaton​ , go to the tip page and read the tip of Step 27, 2022. This tip shows you how to ignore the exception and continue to iterate the next record. Please try and let me know if you have any questions.

 

Regards

Shong

Papademuchos
Creator
Creator
Author

Thanks for the suggestion. My situation is different. In the "Tip of the Day" example, the test is whether an inbound record is valid or not. In my example, the test is whether a database connection is valid or not. The list of database values coming from the left are fine - there is not a problem with the list. It's the connection after the iteration that's blowing up. I tried the Try/Catch suggestion anyways and it still didn't work. It still stops on the first database connection that it has a problem with and doesn't continue iterating. 😞

 

0695b00000dcqMGAAY.png