views:

34

answers:

1

Hi All,

I'm running MySQL from the command line and executing SQL stored in files. What I'm trying to do, is prompt the user to enter input so that I can include this in the SQL script? Is there a way to do this with MySQL?

Many thanks, James

A: 

If you want to execute sql script from the file try this:

mysql -u USER -p -D DATABASE < input_filename.sql
tuffkid
Hi - thanks for that! I've got it running SQL from files (I'm using source <path>) but I'm looking for a way to get user input into the script.
James