Any one experienced with SQLite on Android being different than iOS or the simulator?
Here is my code:
function M:loadTable(k)
print("k is", k, "!")
local query = [[SELECT content FROM history WHERE match IS "]]..[[Match]]..k..[[";]]
print("Query", query)
for row in storyboard.db:nrows(query) do
utility.print\_r(row)
local t = json.decode(row.content)
print("OOOO Fetching data", row.content)
return t
end
end
Here is the output of an adb logcat on my Nexus 7
I/Corona (14713): Query SELECT content FROM history WHERE match IS “Match507e1a99201773000f00038d”;
I/Corona (14713): Lua Runtime Error: lua_pcall failed with status: 2, error message is: near ““Match507e1a99201773000f00038d””: syntax error
So this runs fine in the simulator and my query executes with no errors. I tested it on my iPhone 5 and it also ran fine, no errors. I only see this on Android.
The syntax seems fine when I print the query. The only thing different than the sample app is the sample app has the query string as a physical string inside of db:nrows() and that I init the database in main.lua but do the query in a storyboard module later, so I store the DB file handle in the storyboard table so it’s not global but “globally available” to me. The utility.print_r function is my table printing function and it appears that this syntax error is happening before that print_r().
No, I have not tried the sample app on android yet, going to go do that now.
Thanks
Rob
[import]uid: 19626 topic_id: 32035 reply_id: 332035[/import]
