user2396148
user2396148

Reputation: 11

I am not getting the out put file for the below sql batch file

@echo off

set sql_exe="C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe"
set sql_options=-user root -password amma
set sql_db="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data\aview"
set count=1

for /f "delims=" %%a in (input.sql) do (
  echo %%a > temp.sql
  call :processtemp_sql
)
goto :eof

:processtemp_sql
%sql_exe% %sql_options% -i temp.sql -o output%count%.txt %sql_db%
set /A count=%count%+1
goto :eof

:eof

input.sql has a sql query

select * from status;

Upvotes: 0

Views: 69

Answers (1)

Magoo
Magoo

Reputation: 79983

I've no idea about MYSQL syntax - and the on-line manual isn't much help.... but since you've gone to the trouble of establishing sql_db - shouldn't you be using it somewhere?

Upvotes: 1

Related Questions