views:

85

answers:

1

I need to execute from mysql shell an SQL file based on a condition like mysql> source @var where @var contains the filename

A: 

this is not possible. "source" is a command that is recognized and executed locally by the mysql client program. variables exist on the server so the client has no idea what @variable means.

longneck