control sqlite via shell
Posted: Sat Jan 19, 2008 9:14 am
I am experimenting with the sqlite shell via Revolution with some success. I want to select files from a database. The command
at the shell gives the desired result.
I am using 2 identical databases testxx & testxx2 so that I know which one I am referring to at what time. I know they are being accessed appropriately.
With trial & error and the use of the constant "quote" I can write the same string. The string in parentheses needs to be in quotes. For example answer shell("sqlite3 testxx2.db .database") works correctly.
The next step is to use the shell command-
does not work. The error states "/bin/sh: line 1: sqlite3 testxx2.db select: command not found"
I have tried a variety of things around the * in the select statement, but the error is the same.
Any help most gratefully received. Thank you.
Code: Select all
sqlite3 testxx.db "select * from test"
I am using 2 identical databases testxx & testxx2 so that I know which one I am referring to at what time. I know they are being accessed appropriately.
With trial & error and the use of the constant "quote" I can write the same string. The string in parentheses needs to be in quotes. For example answer shell("sqlite3 testxx2.db .database") works correctly.
The next step is to use the shell command-
Code: Select all
put quote & "sqlite3 testxx2.db" && quote & "select" && "*" && "from test" & quote & quote into shellText
answer shellText --confirms appropriate string
answer shell(shellText)
I have tried a variety of things around the * in the select statement, but the error is the same.
Any help most gratefully received. Thank you.