Records with ,s and returns
Posted: Fri Apr 03, 2020 1:37 pm
I am very new to SQL and databases, so I apologize for what is probably an obvious question.
I am using data that includes commas and returns. This seems to be a problem when building SQL Queries. I discovered that I could solve this problem when I insert a record by using :s as follows:
put "INSERT INTO students (name,class,group1,group2) VALUES (:1,:2,:3,:4)" into scrpt
revExecuteSQL connectID, scrpt,"stName","stClass","stGroup1","stGroup2"
But, I cannot figure out how to do the equivalent with updating. The following does not work:
put "UPDATE students SET (name,class,group1,group2) VALUES (:1,:2,:3,:4) WHERE id="&stID into scrpt
revExecuteSQL connectID, scrpt,"stName","stClass","stGroup1","stGroup2"
Any help would be most appreciated!!! (And if there is a better reference than the LiveCode lessons which are so basic, I'd really appreciate a link)
Thanks! Eric
I am using data that includes commas and returns. This seems to be a problem when building SQL Queries. I discovered that I could solve this problem when I insert a record by using :s as follows:
put "INSERT INTO students (name,class,group1,group2) VALUES (:1,:2,:3,:4)" into scrpt
revExecuteSQL connectID, scrpt,"stName","stClass","stGroup1","stGroup2"
But, I cannot figure out how to do the equivalent with updating. The following does not work:
put "UPDATE students SET (name,class,group1,group2) VALUES (:1,:2,:3,:4) WHERE id="&stID into scrpt
revExecuteSQL connectID, scrpt,"stName","stClass","stGroup1","stGroup2"
Any help would be most appreciated!!! (And if there is a better reference than the LiveCode lessons which are so basic, I'd really appreciate a link)
Thanks! Eric