I want to query a column that has spaces in its name. The shell script is:
select "Column 1" from aTable;
Maybe it is late, but I am having a hard time escaping the Applescript:
set xxx to do shell script "sqlite3 ~/Documents/Databases/test.db \"select \"Address 1\" from aTable limit 10; \""
Use single quotes around your SQL:
set xxx to do shell script "sqlite3 ~/Documents/Databases/test.db 'select \"Address 1\" from aTable limit 10; '"
Or if you want to beat yourself up, keep using double quotes everywhere and add more escaping:
set xxx to do shell script "sqlite3 ~/Documents/Databases/test.db \"select \\\"Address 1\\\" from aTable limit 10; \""
You need three because you have to escape the escapes to get an escaped double quote down to the shell. Ick.
Or better, use a native AppleScript SQLite interface, a couple minutes of googling should find you something nicer than the above nested quote madness.