How to query the database for inputs, and how to use the output in scripts
How to query the database for inputs, and how to use the output in scripts