SQLite and single quote characters

Ludovic THEBAULT ludovic.thebault at laposte.net
Wed Dec 28 14:30:46 EST 2016

> Le 28 déc. 2016 à 19:54, Tore Nilsen <tore.nilsen at me.com> a écrit :
> I am using my Christmas break to try to teach myself how to use SQLite with LiveCode. (Hopefully I will be able to teach my students how to use it also, come January.) In this process I ran into a problem, where the script I used did not insert a new record to the database as expected. Some records were created, others were not, but no errors were reported.
> I managed to track it down to the fact that in the instances where it did not work, some of the data I wanted to register included the use of the single quote character. This resulted in no new records being inserted, but LC did not report any errors.
> As a single quote may be a valid character in some instances where I intend to use SQLite databases, I am now at odds with how to proceed. Does anyone have a solution to this problem?   

Use this formulation :

put "Don’t push me" into tvar

put "Insert Into mytable (mytext) values (:1)" into tSQL
revExecuteSQL pDatabaseID, tSQL, "tvar"

More information about the use-livecode mailing list