Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

unable to use function MATCH in the requested context SQLite?



  • Hello,

    Using local database on my project, I need to make search on it but with my table named "remainPartList_log" and column named "part" and the value inserted in it "PartTest1" when I using the query:

    SELECT * FROM remainPartList_log WHERE part match 'PartTest1'

    I receive the error:
    unable to use function MATCH in the requested context: SELECT * FROM remainPartList_log WHERE part MATCH 'PartTest1'

    but the query:

    SELECT * FROM remainPartList_log WHERE part ='PartTest1' is working fine and return the correct row...

    Could you help me please?

    Kind regards

    Philippe



  • @filipdns
    Suggestion: https://stackoverflow.com/a/14074370/489865

    MATCH is only valid for virtual FTS tables. You need to use LIKE in regular tables.

    ? i.e. MATCH is only for searching in Full Text Search tables. If yours is just a regular table, you must use LIKE. MATCH is against an index of words which is only available for FTS tables.



  • @JonB Hello,

    Yes I just found what you say and solve with:

    SELECT * FROM remainPartList_log WHERE part LIKE '%art%'

    thank you very much


Log in to reply