title: create a batch file loop and restart dependent on user input
body: <p>This is my first batch file and I've been having trouble finding answers (or clues which I can decipher). New to programming, and trying to run multiple .sql statements in a single batch file. This I can do. Problem is, the flie only handles one stock @ a time, and the bottom 2 COUNTS files repeat themselves -- so I need to have them run AFTER the user has changed the stock symbol in the first .sql files and have them loop and run until the last stock is input -- then run the COUNTS files at the end. </p>
  
  <pre><code>@echo off
  cd "C:\Program Files\MySQL\MySQL Server 5.5\bin"
  mysql -h  -u -p -Dstock_market &lt; "C:\mysql assignment 1\good  scripts\load_csv_data_MySQL.sql"
  mysql -h  -u -p -Dstock_market &lt; "C:\mysql assignment 1\good scripts\derived_DAILY.sql"
  mysql -h  -u -p -Dstock_market &lt; "C:\mysql assignment 1\good scripts\derived_MONTHLY.sql"
  mysql -h  -u -p -Dstock_market &lt; "C:\mysql assignment 1\good scripts\derived_DEFAULT_updates.sql"
  
  :this is where I need to have the file either loop back through the above scripts with 
  :a different stock (with files above updated by the batch user who has access to the  .sql files) or when
  :all stocks have been entered, to continue to the 2 .sql scripts below
  
  mysql -h  -uroot -p -Dstock_market &lt; "C:\mysql assignment 1\good scripts\INSERT_INTO_COUNTS_daily.sql"
  mysql -h  -uroot -p -Dstock_market &lt; "C:\mysql assignment 1\good scripts\INSERT_INTO_COUNTS_monthly.sql"
  exit
  </code></pre>
  
  <p>Would really appreciate any assistance (keeping in mind my utter lack of experience w/ batch files)!  P.S. This is a personal assignment and not for any type of school, I'm self
  teaching using only the net as of now (and Murach's MySQL book)...</p>
  
  <p>Thanks!</p>