Jump to content

sqlite3.exe dot command example


Skysnake
 Share

Recommended Posts

; works Local $sqlCLI = 'sqlite3.exe C:/Users/AppData/Local/Temp/~knakvog.tmp ".read sql2csv.txt" '
                Local $sqlCLI = 'sqlite3.exe C:/Users/AppData/Local/Temp/~knakvog.tmp < xpt2csv.txt '

                Local $openCSV = Run(@ComSpec & " /k " & $sqlCLI,@ScriptDir,@SW_HIDE)

Much less impressive than I hoped for.

Change the @SW_HIDE to MAX to see the results of the labour. 

It appears as if SQLITE3.EXE can accept one argument after the dbfile name, so the ".read..." works.  But it does not allow multiple consecutive parameters.

-- sql text file content sql2.csv.txt
.headers on
.mode csv
.once dataout.csv
SELECT * FROM memCSV;
.system dataout.csv
.quit

The above line reads the 'sql2csv.txt' file using either of the "< or .read" options, and executes correctly.

Trying to stipulate all in the AutoIt command line results in failure

Line below does NOT work. 

; not working Local $sqlCLI = 'sqlite3.exe "C:/Users/AppData/Local/Temp/~knakvog.tmp" ".headers on" ".mode csv" ".once dataout.csv" SELECT * FROM memCSV; ".system dataout.csv"  '

Failure appears to be a native SQLITE3 "too many parameters" issue and not related to AutoIt.  

Edited by Skysnake
improved

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...