- May
- 239
- 2
Hi,
I stumbled upon a (to me) strange thing when I generated some SQL for piping to sqlite3.exe.
These two statements where called in a loop:
Two outputs from the echo command were:
So the environment variable inside the parenthesis was not evaluated. (But other variables inside parenthesis elsewhere were evaluated, just not this one.
Adding `` around the parenthesis:es fixed the problem.
Any idea what's going on? Would it always be a good idea (or even necessary in some cases) to use `` around literal (and not meant for e.g. command grouping) parenthesis:es?
I stumbled upon a (to me) strange thing when I generated some SQL for piping to sqlite3.exe.
These two statements where called in a loop:
Code:
set extraWhereCondParsed=%extraWhereCondParsed% OR (%thisCondParsed%)
echo "%extraWhereCondParsed%"
Code:
"("Last Name" LIKE 'b*') OR (%thisCondParsed%)"
"("Last Name" LIKE 'b*') OR (%thisCondParsed%) OR (%thisCondParsed%)"
Adding `` around the parenthesis:es fixed the problem.
Code:
set extraWhereCondParsed=%extraWhereCondParsed% OR `(`%thisCondParsed%`)`
echo "%extraWhereCondParsed%"
"("Last Name" LIKE 'b*') OR ("First Name" LIKE 'a*')"
"("Last Name" LIKE 'b*') OR ("First Name" LIKE 'a*') OR ("First Name" LIKE 'a*')"