Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved unable to use function MATCH in the requested context SQLite?

    3rd Party Software
    2
    3
    2344
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      filipdns last edited by

      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

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @filipdns last edited by JonB

        @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.

        F 1 Reply Last reply Reply Quote 3
        • F
          filipdns @JonB last edited by

          @JonB Hello,

          Yes I just found what you say and solve with:

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

          thank you very much

          1 Reply Last reply Reply Quote 0
          • First post
            Last post