Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7717321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:51:39+00:00 2026-06-01T02:51:39+00:00

I’m using the following query to perform a search in SQLite. public MatrixCursor listViewCursor(String

  • 0

I’m using the following query to perform a search in SQLite.

public MatrixCursor listViewCursor(String query) {
    open();
    Cursor dcursor = null;
    MatrixCursor cursor = new MatrixCursor(listviewColumns);
    Object[] listviewarray = null;
    String[] selectionArgs = new String[] { query };
    System.out.println("Selectionarg = "+selectionArgs.toString());
    if (query == null) {
        try {// this works
            dcursor = database.query(LA_DATABASE_TABLE, listviewColumns,
                    null, null, null, null, LA_TEST_NAME);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else
        try {// this don't work!!!
            dcursor = database.query(LA_DATABASE_TABLE, listviewColumns,
                    LA_TEST_NAME + " MATCH ?", new String[] { query }, null, null, null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    System.out.println("dcursor count = "+dcursor.getCount());
    listviewarray = new Object[dcursor.getColumnCount()];
    if (dcursor.moveToFirst()) {
        do {

            for (int i = 0; i < dcursor.getColumnCount(); i++) {
                listviewarray[i] = dcursor.getString(i);
            }
            cursor.addRow(listviewarray);
            System.out.println(dcursor.getString(1));
        } while (dcursor.moveToNext());
    } else
        return null;
    close();
    return cursor;

}

However I’m getting the following error.

0

1-01 04:36:27.376: I/SqliteDatabaseCpp(3171): sqlite returned: error code = 1, msg = statement aborts at 7: [SELECT _id, suggest_text_1, test_value_1, test_value_2, test_type_1 FROM la_table WHERE suggest_text_1 MATCH ?] unable to use function MATCH in the requested context, db=/data/data/com.assistant.lab.royale/databases/la_db
01-01 04:36:27.376: E/SQLiteQuery(3171): exception: SQL logic error or missing database; query: SELECT _id, suggest_text_1, test_value_1, test_value_2, test_type_1 FROM la_table WHERE suggest_text_1 MATCH ?
01-01 04:36:27.376: D/AndroidRuntime(3171): Shutting down VM
01-01 04:36:27.376: W/dalvikvm(3171): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-01 04:36:27.465: E/AndroidRuntime(3171): FATAL EXCEPTION: main
01-01 04:36:27.465: E/AndroidRuntime(3171): android.database.sqlite.SQLiteException: SQL logic error or missing database
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.database.sqlite.SQLiteQuery.nativeFillWindow(Native Method)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:86)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:164)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at com.assistant.lab.royale.DataSource.listViewCursor(DataSource.java:52)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at com.assistant.lab.royale.LabAssistant.filterListView(LabAssistant.java:32)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at com.assistant.lab.royale.LabAssistant.onQueryTextChange(LabAssistant.java:54)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.widget.SearchView.onTextChanged(SearchView.java:1091)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.widget.SearchView.access$2000(SearchView.java:90)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.widget.SearchView$11.onTextChanged(SearchView.java:1548)
01-01 04:36:27.465: E/AndroidRuntime(3171):     at android.widget.TextView.sendOnTextChanged(TextView.java:7634)

Why is this happening

EDIT :

I fixed it using dcursor = database.query(LA_DATABASE_TABLE, listviewColumns , LA_TEST_NAME + " LIKE '%"+query+"%'",null, null, null, null); but I’d like to know why the above code didn’t work. Seems like ? is not getting replaced properly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:51:40+00:00Added an answer on June 1, 2026 at 2:51 am

    See the Introduction to FTS3 and FTS4 from here http://sqlite.org/fts3.html

    and make sure you created a virtual table like this

     CREATE VIRTUAL TABLE enrondata1 USING fts3(content TEXT);
    

    not an ordinary like this

    CREATE TABLE enrondata2(content TEXT);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.