C
Csaba Gabor
How can I pass along an exclamation point?!? I have a "!=" that I
should send to a file I build up:
FOR %%G IN (%tableList%) DO (
....build up a SQL batch file...
ECHO REPLACE INTO %MapTable% >> sqlBatch
ECHO %veryUglySelectStatement% >> sqlBatch
ECHO WHERE tmp.Info!='' AND mp.Info!=tmp.Info; >> sqlBatch
....
)
REM Now execute the SQL statements
c:\mySQL\bin\mysql.exe -N Map <sqlBatch
The "!" are not sent to the batch file. I tried putting a ^ in front (which
is what
I do for a closing parenthesis in a loop to prevent the interpreter from
thinking
the loop is ending. Ie. "^)"), but this did not do the trick. I tried
using <> instead, but the interpreter didn't like that either, and I didn't
figure
out how to escape the ">" either.
My hacky workaround is to do
ECHO WHERE NOT(tmp.Info=''^) AND NOT(mp.Info=tmp.Info^); >> sqlBatch
but that's just not very satisfying. Actually, I'm interested in how to
escape characters
in general - and the specific instance (!) is the motivation.
Thanks for any tips,
Csaba Gabor
should send to a file I build up:
FOR %%G IN (%tableList%) DO (
....build up a SQL batch file...
ECHO REPLACE INTO %MapTable% >> sqlBatch
ECHO %veryUglySelectStatement% >> sqlBatch
ECHO WHERE tmp.Info!='' AND mp.Info!=tmp.Info; >> sqlBatch
....
)
REM Now execute the SQL statements
c:\mySQL\bin\mysql.exe -N Map <sqlBatch
The "!" are not sent to the batch file. I tried putting a ^ in front (which
is what
I do for a closing parenthesis in a loop to prevent the interpreter from
thinking
the loop is ending. Ie. "^)"), but this did not do the trick. I tried
using <> instead, but the interpreter didn't like that either, and I didn't
figure
out how to escape the ">" either.
My hacky workaround is to do
ECHO WHERE NOT(tmp.Info=''^) AND NOT(mp.Info=tmp.Info^); >> sqlBatch
but that's just not very satisfying. Actually, I'm interested in how to
escape characters
in general - and the specific instance (!) is the motivation.
Thanks for any tips,
Csaba Gabor