Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments to function trim() #359

Open
nielscup opened this issue Jul 4, 2017 · 3 comments
Open

wrong number of arguments to function trim() #359

nielscup opened this issue Jul 4, 2017 · 3 comments

Comments

@nielscup
Copy link

nielscup commented Jul 4, 2017

Hi, I get the following error message in my Windows 8.1 project when I use Trim() in a query. I am using the following package: SQLite.Net.Core-PCL 3.1.1. I also have this error when I use Replace(" ", ""). Hope you are able to fix this. Please let me know if you need any more information. Thanks!

wrong number of arguments to function trim()

   at SQLite.Net.Platform.WinRT.SQLiteApiWinRT.Prepare2(IDbHandle db, String query)
   at SQLite.Net.SQLiteCommand.Prepare()
   at SQLite.Net.SQLiteCommand.<ExecuteDeferredQuery>d__15`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at SQLite.Net.TableQuery`1.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at SQLite.Net.Async.AsyncTableQuery`1.<>c__DisplayClass11_0.<ToListAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at BundL.Common.Repositories.LocalRepository.<GetListAsync>d__5`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at BundL.Common.Repositories.Repository.<GetData>d__11`1.MoveNext()
@webmetender
Copy link

Old issue but I am getting the same type of error.

I am using SQLite-net-pcl 1.5.231.

Whenever I use a Trim() in a Where() query I get a "wrong number of arguments to function trim()" error.

For exemple, calling:

var dbProvinces = DB.Table<Province>().Where(x => x.Code.Trim().ToUpper() == code);

I get:

wrong number of arguments to function trim()
at SQLite.SQLite3.Prepare2 (SQLitePCL.sqlite3 db, System.String query) [0x0001b] in <eaa146ee868043e287f5507c8701ad9e>:0 
  at SQLite.SQLiteCommand.Prepare () [0x00011] in <eaa146ee868043e287f5507c8701ad9e>:0 
  at SQLite.SQLiteCommand.ExecuteScalar[T] () [0x00036] in <eaa146ee868043e287f5507c8701ad9e>:0 
  at SQLite.TableQuery`1[T].Count () [0x0000b] in <eaa146ee868043e287f5507c8701ad9e>:0 
  at ....ProvinceDB.Get (System.String code, System.Boolean onlyEnabled) [0x00192] in /.../DB/ProvinceDB.cs:37

Should this error be reported in the SQLitePCL.raw project?

@chandrappaudel
Copy link

chandrappaudel commented Sep 20, 2019

any updates about the resolution? I'm still getting an exception whenever I try using .Trim()

@Menci77
Copy link

Menci77 commented Nov 12, 2021

Any solutions? I'm struggling with the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants