Page 1 of 1

issuing dot commands to sqlite through livecode

Posted: Fri Aug 20, 2021 2:16 pm
by bbalmerTotalFluency
Hello:

I'd like to issue some commands such as .tables and .mode and .timer etc. Is it possible from within livecode? I can't seem to make it work but there is an extremely good chance I have missed something clever.

Bruce

Re: issuing dot commands to sqlite through livecode

Posted: Fri Aug 20, 2021 6:55 pm
by Klaus
Hi Briuce,

looks like LC does really not like commands/functions that start with a DOT! :shock:
Use the underscore instead, that does not make any problems.

Or are these (.table etc.) special SQLite commands?
In that case you can surely use them like -> put ".table" into tSQL


Best

Klaus

Re: issuing dot commands to sqlite through livecode

Posted: Sat Aug 21, 2021 5:04 am
by bbalmerTotalFluency
Hi Klaus:

Are you paid to answer questions or are you simply the most generous guy I've met (virtually)? If the former "what a good job you are doing", if the latter "blimey! What a nice guy".

.commands are special commands in sqlite3 for example if I am running sqlite3 in my terminal and I issue ".tables" sqlite3 will provide me a list of all the tables in the attached database.

I've tried issuing them from within LC but so far LC has been unresponsive to my charms. To be specific I can issue the command of course but sqlite3 will not provide me with a response.

Bruce

Re: issuing dot commands to sqlite through livecode

Posted: Sat Aug 21, 2021 9:05 am
by SparkOut
Klaus is a REALLY nice guy.
And he's 8)

There are some (rather occasional) visits and posts by LC staff, but this is a user to user help forum, everyone is a volunteer, and it's not the normal channel of support from LC.

Re: issuing dot commands to sqlite through livecode

Posted: Sat Aug 21, 2021 10:14 am
by AxWald
Hi,

AFAIK ".tables" is syntax specific to the SQLite command-line program ("sqlite3"/ "sqlite3.exe"), and NOT part of the supported "dialect of the SQL language".

Since LC communicates with the DB using queries in "SQL language" this may not work. But you may use it via shell:

Code: Select all

   get shell(myPath & slash & "sqlite3 .tables")
(or something like it ;-))

I may be wrong. Have fun!

Re: issuing dot commands to sqlite through livecode

Posted: Sun Aug 22, 2021 3:36 am
by bbalmerTotalFluency
AxWald:

Genius! That, or some form of that will be the answer. Thank you SO MUCH. I love it!

Bruce