I would like to pass an argument from a batch file to SQL file(for SQLite). I had no luck finding this method online, is it possible to do? If not, is there any alternative way?
For example, here is what I wanted to do:
In batch file I wanted to pass %arg1% to sqlTest.sql:
@echo off
set arg1=%1
echo .quit | sqlite3.exe -init sqlTest.sql %arg1%"
In sqlTest.sql file:
.open "db/code_status.db"
SELECT FileName, FilePath, Author
FROM CodeStatus
LEFT JOIN CodeFile ON CodeStatus.ChangeId = CodeFile.ChangeId
WHERE WorkItemId = 2197
ORDER BY ModifiedDate ASC;
For WHERE WorkItemId = 2197, I would like to replace 2197 to the argument value from batch.
Any solution?, thanks!