> > The obvious answer is that can be accomplished with a scripting > language of your choice such as Perl,PHP, or Bash. If you want to stay > SQL-ish, you can use mysqltest, the tool used in the MySQL test suite. > It has eval command, so you can do something like this: > > let $db = `select db from databases where id = 1`; > eval use $db; > > You do have to use a hack, though, since that tool is not meant for > regular non-testing use: > > mysqltest -r -R /tmp/out.txt script.sql > cat /tmp/out.txt > > However, if it is for testing, the test nature of the tool can come > handy, because it is capable of comparing the actual output with a > master file. > > For more details, mysqltest --help >
Thanks for the input. I'll definitely be checking out mysqltest. It may prove very useful. AJ ONeal
