F Frank Cazabon Member Licensed User Longtime User Jul 8, 2014 #1 Hi, I'm pretty new to this and have got stuck trying to store the selected List Value from a ListView into a SQLite table. This is my code: Code: Sub lvwRoutes_ItemClick (Position As Int, Value As Object) Dim Query As String Query = "INSERT INTO SelectedRoute (srt_name) VALUES (Value)" Main.SQLLite.ExecNonQuery(Query) End Sub But I get this run time error: android.database.sqlite.SQLiteException: no such column: Value (code 1): , while compiling: INSERT INTO SelectedRoute (srt_name) VALUES (Value) My table was created like this: Code: Query = "CREATE TABLE SelectedRoute (srt_name text null)" SQLLite.ExecNonQuery(Query) Am I using incorrect syntax in the INSERT statement or do I need to do something with the Value object before trying to insert it?
Hi, I'm pretty new to this and have got stuck trying to store the selected List Value from a ListView into a SQLite table. This is my code: Code: Sub lvwRoutes_ItemClick (Position As Int, Value As Object) Dim Query As String Query = "INSERT INTO SelectedRoute (srt_name) VALUES (Value)" Main.SQLLite.ExecNonQuery(Query) End Sub But I get this run time error: android.database.sqlite.SQLiteException: no such column: Value (code 1): , while compiling: INSERT INTO SelectedRoute (srt_name) VALUES (Value) My table was created like this: Code: Query = "CREATE TABLE SelectedRoute (srt_name text null)" SQLLite.ExecNonQuery(Query) Am I using incorrect syntax in the INSERT statement or do I need to do something with the Value object before trying to insert it?
F Frank Cazabon Member Licensed User Longtime User Jul 8, 2014 #2 LOL, I think I see the problem: I need to build the query string like this - Code: Query = "INSERT INTO SelectedRoute (srt_name) VALUES ('" & Value & "')" A follow up question: Is it possible to do this passing parameters? Something like: Query = "INSERT INTO SelectedRoute (srt_name) VALUES (?Value)" Upvote 0
LOL, I think I see the problem: I need to build the query string like this - Code: Query = "INSERT INTO SelectedRoute (srt_name) VALUES ('" & Value & "')" A follow up question: Is it possible to do this passing parameters? Something like: Query = "INSERT INTO SelectedRoute (srt_name) VALUES (?Value)"
F Frank Cazabon Member Licensed User Longtime User Jul 8, 2014 #4 Thanks, I will check that out. I did find ExecNonQuery2 which allows me to pass in an array of parameters. Upvote 0
Thanks, I will check that out. I did find ExecNonQuery2 which allows me to pass in an array of parameters.
KMatle Expert Licensed User Longtime User Jul 8, 2014 #5 Have a look here: http://www.b4x.com/android/forum/th...a-server-using-httputils2-part-2-mysql.42456/ Upvote 0
Have a look here: http://www.b4x.com/android/forum/th...a-server-using-httputils2-part-2-mysql.42456/