Is there a way/workaround/hack to pass an argument to a mysql script? Let's say I have a file name myqueries.sql which looks like this
SELECT * FROM FooBar where id = <arg>;
Then in mysql command, I know I can call this script by
mysql>source myqueries.sql
But is there a way to pass an argument here? Something like this:
mysql>source myqueries.sql 2
then I'd get the tuple with id = 2.