Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. unable to use function MATCH in the requested context SQLite?
QtWS25 Last Chance

unable to use function MATCH in the requested context SQLite?

Scheduled Pinned Locked Moved Solved 3rd Party Software
3 Posts 2 Posters 3.2k Views
  • 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 Offline
    F Offline
    filipdns
    wrote on 26 Feb 2020, 07:40 last edited by
    #1

    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

    J 1 Reply Last reply 26 Feb 2020, 08:02
    0
    • F filipdns
      26 Feb 2020, 07:40

      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

      J Offline
      J Offline
      JonB
      wrote on 26 Feb 2020, 08:02 last edited by JonB
      #2

      @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 26 Feb 2020, 08:06
      3
      • J JonB
        26 Feb 2020, 08:02

        @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 Offline
        F Offline
        filipdns
        wrote on 26 Feb 2020, 08:06 last edited by
        #3

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

        1/3

        26 Feb 2020, 07:40

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved