Is it possible to make a sql script use a variable defined externally?
E.g. I have the following script:
UPDATE mytable
SET valid = 0
WHERE valid = 1
which I have to run through mysql
command line several times, each with a different table name.
I would like something like:
SET table_name=foo
mysql -uuser -ppassword < myscript.sql
is it possible?