I am trying the following query using a preloaded sqlite DB in a Monotouch project:
select * from my_table where id not in (1,2,3,4) and field not in ('תווים בעברית') order by RANDOM() limit 55;
but I keep getting a SQLiteException. If I replace the hebrew string with english characters it works fine.
How can I solve this issue?
Also notice that the same exact query works fine in an Android project (written in Java).
EDIT (Code)
var conn = new SQLiteConnection (System.IO.Path.Combine (folder, "mydb.db3"));
string sql = select * from my_table where id not in (1,2,3,4) and field not in ('תווים בעברית') order by RANDOM() limit 55;
IEnumerable<myObject> objects = conn.Query<myObject> (sql.ToString()); //Here is the exception
The Exception thrown:
SQLite.SQLiteException: near "lim": syntax error at SQLite.SQLite3.Prepare2 (IntPtr db, System.String query) [0x00000] in :0 at SQLite.SQLiteCommand.Prepare () [0x00000] in :0 at SQLite.SQLiteCommand+d_0
1[MyAppName.Question].MoveNext () [0x00000] in <filename unknown>:0 at System.Collections.Generic.List
1[MyAppName.Question].AddEnumerable (IEnumerable1 enumerable) [0x00000] in <filename unknown>:0 at System.Collections.Generic.List
1[MyAppName.Question]..ctor (IEnumerable1 collection) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable.ToList[Question] (IEnumerable
1 source) [0x00000] in :0 at SQLite.SQLiteCommand.ExecuteQuery[Question] () [0x00000] in :0 at SQLite.SQLiteConnection.Query[Question] (System.String query, System.Object[] args) [0x00000] in :0 at MyAppName.DBHelper.getQuestions (Int32 level) [0x000f1] in /Users/mmac/Documents/projects/MyAppNameMono/MyAppName/MyAppName/dal/DBHelper.cs:43 at MyAppName.AppDelegate.m_0 (System.Object ) [0x00002] in /Users/mmac/Documents/projects/MyAppNameMono/MyAppName/MyAppName/AppDelegate.cs:36