Run SQL commands through Notepad++

Joined
Nov 24, 2021
Messages
3
Reaction score
0
I am trying to start out using Notepad++ to run SQLite commands. I have tried following two brief YouTube tutorials to get me going. I can run the initial .bat file but still cannot run the .sql file.

I have a Windows system environment Path variable set to the folder containing sqlite3.exe

Code:
"C:\Users\Adam\sqlite\"

I have saved the following file RunSQLite.bat in the folder containing sqlite3.exe

Code:
sqlite3.exe testDB.db

I have created a second file queries.sql

Code:
SELECT 34;

When I try to run queries.sql from Notepad++, using the RUN command:

Code:
C:\Users\Adam\sqlite\RunSQLite.bat "$(FULL_CURRENT_PATH)"

the only file that appears to run is RunSQLite.bat, giving the output:

SQLite version 3.36.0 2021-06-18 18:36:39 Enter ".help" for usage hints. sqlite>

Can anyone tell where I have gone wrong?

Thanks in advance.




---------------------------------------------
This was the C Interview Questions.
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
Judging by the "sqlite>" at the end, it's dropping into a SQLite shell instead of running the SQL file. I also don't see where you're using the argument you're passing to the batch file. Try changing your SQLite command to the following.
Bash:
sqlite3.exe testDB.db -init %1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top