Re: SQL Insert Syntax

2018-01-05 Thread Bob Sneidar via use-livecode
Hi all. Here's a new toy for everyone to play with. It takes a numbered array of key/value pairs and converts it to a MEMORY database. Why you ask? So you can query against it of course! In my particular case I am getting an array of every object on a card EXCLUDING objects that are elements

Re: SQL Insert Syntax

2018-01-05 Thread Bob Sneidar via use-livecode
For now I am just dropping the table and recreating it. Bob S > On Jan 5, 2018, at 14:28 , Bob Sneidar via use-livecode > wrote: > > 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 da

Re: SQL Insert Syntax

2018-01-05 Thread Bob Sneidar via use-livecode
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

Re: SQL Insert Syntax

2018-01-05 Thread Mike Kerner via use-livecode
the only problem is your quoted column names. On Fri, Jan 5, 2018 at 4:38 PM, Devin Asay via use-livecode < use-livecode@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

Re: SQL Insert Syntax

2018-01-05 Thread Devin Asay via use-livecode
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 revExecuteSQ

Re: SQL Insert Syntax

2018-01-05 Thread Mike Bonner via use-livecode
Use the placeholder method? put your data into a numerically keyed array and change the insert to this.. INSERT INTO arraydata ("rect","controlname","owner","visible") VALUES (:1,:2,:3,:4) On Fri, Jan 5, 2018 at 2:24 PM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > Possi

Re: SQL Insert Syntax

2018-01-05 Thread Bob Sneidar via use-livecode
Possibly, but every sqLite reference I've looked at seems to indicate that I should enclose string values with single quotes, and since my text contains double quotes, I thought that would do the trick. I have tried escaling quotes ie. \" but that doesn't work either. This BTW is why I use sql

Re: SQL Insert Syntax

2018-01-05 Thread Devin Asay via use-livecode
Bob, Some SQL dialects accept both single and double quotes as string delimiters. Might that be the problem? Devin On Jan 5, 2018, at 2:16 PM, Bob Sneidar via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: Can anyone find anything wrong with this sqLite insert statement? INSERT I

SQL Insert Syntax

2018-01-05 Thread Bob Sneidar via use-livecode
Can anyone find anything wrong with this sqLite insert statement? INSERT INTO arraydata ("rect","controlname","owner","visible") VALUES ('0,43,500,543','image "fresh_snow.png"','card "Main"','false') It doesn't generate an error, but neither does it insert anything! There is a primary key colu