SQLite Forum

Input from Windows Batch file
Login
Thanks for the response; I'll wait for the next release as applying the patch is beyond my reach at present.

Not having much success with the work around; here's my session on Windows 10:

/* the database is open & has the table */

sqlite> .open ./db/techniques.db

sqlite> .tables

tblSalesRevenue

/* I am using the latest pre-compiled binary, I believe */

sqlite> .version

SQLite 3.33.0 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f
zlib version 1.2.11
gcc-5.2.0

/* trying the workaround */

sqlite> .read '"D:/SQLite32/SCRIPTS/Techniques/N Random Records.BAT" tblSalesRevenue 10'

Error: cannot open ""D:/SQLite32/SCRIPTS/Techniques/N Random Records.BAT" tblSalesRevenue 10"

/* the batch file exists AND produces the SQL statement correctly */

sqlite> .shell "D:/SQLite32/SCRIPTS/Techniques/N Random Records.BAT" tblSalesRevenue 10

D:\SQLite32>echo SELECT * FROM [tblSalesRevenue] ORDER BY RANDOM() LIMIT 10;

SELECT * FROM [tblSalesRevenue] ORDER BY RANDOM() LIMIT 10;

The batch file has just one line:

echo SELECT * FROM [%1] ORDER BY RANDOM() LIMIT %2;

What am I missing? (thanks for your patience, I've just started looking as SQLite)