tcgoh Active Member Licensed User Longtime User Jul 8, 2012 #1 Hi, I have a edittext.text value that I wanted to insert into a SQL table, but I am unable to get the code right, what is wrong? SQL1.ExecNonQuery("INSERT INTO CREW VALUES(' " & edittext.text & " ', 'b', 'c', 'd', 'e')") Thanks
Hi, I have a edittext.text value that I wanted to insert into a SQL table, but I am unable to get the code right, what is wrong? SQL1.ExecNonQuery("INSERT INTO CREW VALUES(' " & edittext.text & " ', 'b', 'c', 'd', 'e')") Thanks
NJDude Expert Licensed User Longtime User Jul 8, 2012 #2 Try this: B4X: SQL1.ExecNonQuery2("INSERT INTO CREW VALUES (?,?,?,?,?)", Array As String(EditText.Text, "b", "c", "d", "e") Upvote 0
Try this: B4X: SQL1.ExecNonQuery2("INSERT INTO CREW VALUES (?,?,?,?,?)", Array As String(EditText.Text, "b", "c", "d", "e")
tcgoh Active Member Licensed User Longtime User Jul 8, 2012 #3 NJDude said: Try this: B4X: SQL1.ExecNonQuery2("INSERT INTO CREW VALUES (?,?,?,?,?)", Array As String(EditText.Text, "b", "c", "d", "e") Click to expand... Thanks, that worked. BTW what the diff between Array as String & Array as Object? Sorry I'm Noob and no proper training in programing. Upvote 0
NJDude said: Try this: B4X: SQL1.ExecNonQuery2("INSERT INTO CREW VALUES (?,?,?,?,?)", Array As String(EditText.Text, "b", "c", "d", "e") Click to expand... Thanks, that worked. BTW what the diff between Array as String & Array as Object? Sorry I'm Noob and no proper training in programing.
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2012 #4 BTW what the diff between Array as String & Array as Object? Click to expand... There is no difference in this case. If you want to add BLOB fields which are made of arrays of bytes then you need to use Array As Object. Otherwise the bytes array will be converted to a meaningless string. Upvote 0
BTW what the diff between Array as String & Array as Object? Click to expand... There is no difference in this case. If you want to add BLOB fields which are made of arrays of bytes then you need to use Array As Object. Otherwise the bytes array will be converted to a meaningless string.
merlin2049er Well-Known Member Licensed User Longtime User Nov 26, 2013 #5 Thanks, took a while before I realized that I should have been using SQL1.ExecNonQuery2 instead of SQL1.ExecNonQuery1 Upvote 0
Thanks, took a while before I realized that I should have been using SQL1.ExecNonQuery2 instead of SQL1.ExecNonQuery1