-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
? is not recognized as parameter in '?' #316
Comments
I think the percent character should be in the parameter, not in the query. Can you try something like this: db.query(
tableName,
where: "title LIKE ?",
whereArgs: ['%$search%'],
); |
Okay, it working, thank you. |
@alextekartik
Then I got the error: |
That sounds like a different issue. |
I can query the items from this table without any errors, but after performing the above command then I got the error. |
It looks like a database corruption issue: https://sqliteviewer.com/blog/database-disk-image-malformed Your query looks fine to me. |
When I replace the where condition:
It works without error but the result is only one item that is the reason I want to use the like :(. Thank you for your message. |
It seems that when the database is corrupted it does not fail for all queries. Why it fails on this one I don't know. You should try to fix the database (https://www.sqlite.org/faq.html#q21) first. If you want can either attach your db file or send it to me (alex@tekartik.com) so I can take a closer look. This is different from the original issue so it might be better to create a new issue to continue tracking this. |
Thank you for helping, I solve the problem by fixing my database. |
@liemvo Great! I'll be interested in knowing the steps (external tool, pragma...) you did in case someone else encounter this issue. Thanks! |
Hello,
I am using sqflite: ^1.1.7+2
I experienced something strange when I run this code:
I got error:
I tried to change it to:
but still got same error.
But, if I do like this:
It working.
Sorry if this question asked already,
The text was updated successfully, but these errors were encountered: