Following is how to generate dynamic SQL in a shell script and then execute those queries.
Let’s say, for instance, that you have a list of tables that you want to flush regularly during development and don’t want to type in the SQL queries each time. Moreover, you just want to maintain a list of the table names and add and remove from it when necessary and have your script dynamically generate and execute the delete statements.
For the purposes → Continue reading “Executing Dynamically Generated SQL Queries from a Shell Script”