I have a simple workflow that needs to query data on multiple database tables. Most of these tables have the column name I’m trying to query, though some do not. (I do not necessarily know which tables do not have the column name.)
I have a simple loop that goes through the different tables and queries the data (a simple count of the rows), and this works fine, until it reaches a table where the column name does not exist. I’m having trouble figuring out how to get the workflow to skip a variable row if there is an error.
This is my workflow thus far:
I’ve also explored some of the IF/Switch/Error handling nodes, but haven’t had any luck thus far.
Thank you for your help!
I’ve gotten the output to display an error if the column name doesn’t exist, but unfortunately the workflow breaks at that point. It doesn’t continue down the list of variables. This is with the Try/Catch Error nodes… So… Still searching for a solution but getting a little bit closer.
Well, looks like I got this to work now. All I did from the previous screenshot was check the box below.
This seems to have made it work now… If there is an error, it writes, “fail” in the row in the CSV file, then continues through the list of variables. Hopefully this post helps someone in the future that has this same issue.
OK I built something because also I wanted to experiment with databases and switches. I use SQLite because it provides a simple DB. You might switch that out.
What it does it lists all the databases table1 - table4. Three tables have the column “sales” one does not. The Loop would extract all structures from every table and see if a column “sales” is there. If yes the DB would be loaded, if not the database is skipped.
It uses Vernalis nodes and also an old entry from Iris.
kn_example_sqlite_skip_missing_column.knwf (113.4 KB)