Dim SQLa As SQL
Dim query As String="INSERT INTO things(name) VALUES (?)"
SQLa.ExecNonQuery2(query,Array As String("'Neil O''Donnel'"))
'or use DBUtils.InsertMaps
Dim lom As List
lom.Initialize
Dim m As Map =CreateMap("name":"'Neil O''Donnel'")
lom.add(m)
DBUtils.InsertMaps(SQLa,"things",lom)
a line is missing , sqla should be initialized first. Make sure that .db file and table(things) and col(name) exists first.
And you don't need to escape quote(') in both case.
B4X:
Dim SQLa As SQL
'missing line: init SQLa
SQLa.InitializeSQLite(File.DirApp,"test.db",False)
Dim query As String="INSERT INTO things(name) VALUES (?)"
SQLa.ExecNonQuery2(query,Array As String("Neil O'Donnel"))
'or use DBUtils.InsertMaps
Dim lom As List
lom.Initialize
Dim m As Map =CreateMap("name":"Neil O'Donnel")
lom.add(m)
DBUtils.InsertMaps(SQLa,"things",lom)