Good evening, We are trying to generate automated SQLITE  SQL scripts based on 
the names of SQLite tables derived by substring manipulation of Windows DOS 
batch file and/or Windows environment variables. For example:
 
/*   mary.bat */
FOR /f %%a IN ('dir /b *.zip') DO CALL sub %%a
 
 
/* sub.bat */
set str=%1
set camster=%str:~0.17%
echo %str:~0,17%
E:\users\marc\NJM\spatialite_tool.exe -i -shp %str:~0,17% -d 
e:\users\marc\NJM\mdMatchup.dat -t %str:~0,17% -g Geometry -c CP1252 -s 4269 
E:\users\marc\NJM\sqlite.exe -line e:\users\marc\NJM\mdMatchup.dat "drop table 
%camster%;"
 
 
Invoking mary.bat at the command line generates the following command script:
 
E:\TIGER2011\COUSUB>CALL sub tl_2011_78_cousub.zip
E:\TIGER2011\COUSUB>set str=tl_2011_78_cousub.zip
E:\TIGER2011\COUSUB>set camster=str:~0.17
E:\TIGER2011\COUSUB>echo tl_2011_78_cousub
tl_2011_78_cousub
E:\TIGER2011\COUSUB>E:\users\marc\NJM\spatialite_tool.exe -i -shp tl_2011_78_cou
sub -d e:\users\marc\NJM\mdMatchup.dat -t tl_2011_78_cousub -g Geometry -c CP125
2 -s 4269
SQLite version: 3.6.16
SpatiaLite version: 2.3.1
load shapefile error: table 'tl_2011_78_cousub' already exists
 
E:\TIGER2011\COUSUB>E:\users\marc\NJM\sqlite.exe 
-line e:\users\marc\NJM\mdMatchup.dat "drop table str:~0.17;"
SQL error: unrecognized token: ":"

rather than drop table t1_2011_78_cousub.
 
Is it possible that we using the wrong SQLite syntax in the sqlite3.exe -line 
database "sql_statement;"? If so, what might be the correct sqlite command 
string to drop the table t1_2011_78_cousub? Thank you very much.
                                          
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to