SQL Insert Syntax

Bob Sneidar bobsneidar at iotecdigital.com
Fri Jan 5 17:28:00 EST 2018


Thanks for your help all. 

I think with everyone's help I have it working, but now I am trying to use a memory based database using :MEMORY: for the database name. I ensured all databases are closed using revOpenDatabases() which returns empty. But now each time I attempt to create the database I get the result "table "array data" already exists. I though closing a memory database deletes it from memory. If not, how do you clear a memory database?

Bob S

> On Jan 5, 2018, at 13:38 , Devin Asay via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Bob,
> 
> You could try parameterizing your statements as described in the dictionary. Also, you don’t want to quote your column names.
> 
> put 0,43,500,543 into tRect
> put “image “ & quote & “fresh_now.png” & quote into tObj
> put “card “ & quote & “Main” & quote into tCard
> put false into tVis
> revExecuteSQL myID, "insert into arraydata (rect,controlname,owner,visible) values(:1,:2,:3,:4)", “tRect" ,”tObj”,”tCard”, “tVis”
> 
> This is also best practice, because it protects against SQL injection attacks. (Admittedly more of a concern with network databases.)
> 
> HTH
> 
> Devin



More information about the use-livecode mailing list