Originally posted by tomorrower at 2006-9-28 05:12:
This is also incorrect:
for /f "tokens=2,3* delims=|" %%i in (txip1.txt)
do ( echo 'update dzhd_t_txfjxx set v_ip=%%k where c_jgbh=%%i and c_txdm=%%j ;' >a.sql)
The prompt is:
...
The problem with the code on the first floor is indeed that the redirection is not within the execution range of the FOR statement.
And the modified code here is also incorrect. It is recommended to look at for /?!
The code is modified as follows:
@echo off
for /f "tokens=2,3* delims=|" %%i in (txip1.txt) do (
echo 'update dzhd_t_txfjxx set v_ip=%%k where c_jgbh=%%i and c_txdm=%%j ;' >>a.sql
)
pause
Just found out after posting the thread that the original intention of the landlord is not that the sentence >a.sql is to overwrite. The landlord may want to append >>a.sql
[
Last edited by pengfei on 2006-9-28 at 05:48 ]