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

  • Home
  • SEARCH
  • 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 8084351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:46:09+00:00 2026-06-05T17:46:09+00:00

I need help with comparing a column to a string. There is a column

  • 0

I need help with comparing a column to a string. There is a column in the android database and it stores on and off in strings. I need to compare the column to “On” string and if there is any On in that column i need it to return true and if there is no on in the database return false how do i do this ?

my code

public boolean QuickTime(){

      String myQuery = "SELECT * FROM DATABASE_TABLE_QUICK WHERE ALARM_ID_QUICK LIKE 'On' ";
      Cursor mCursor = databaseConnect.rawQuery(myQuery, null);
      if(mCursor.getCount()>0)  //if at least one record contains 'on'
          return true;
      else
          return false; //no record was found with the word 'on'
  }
  • 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-05T17:46:10+00:00Added an answer on June 5, 2026 at 5:46 pm

    an easy (not the best) way to do it is with Rawquery .
    so all you would have to do is something like:

    private boolean containsOn(SQLiteDatabase mSQLiteDatabase){
        String myQuery = "SELECT * FROM MYTABLE WHERE status LIKE 'on' ";
        Cursor mCursor = mSQLiteDatabase.rawQuery(myQuery, null);
        mCursor.
        if(mCursor.getCount()>0)  //if at least one record contains 'on'
            return true;
        else
            return false; //no record was found with the word 'on'
    }
    

    all you would have to do is pass your sqlLite database, change the table name and the status column for your column name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help with my script that is comparing current date with date that
I need help getting two pieces of data, and comparing them. What I am
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
need help in error in database pivot. i have table tamed table_score like below:
I need help with a function so that I can upload a picture from
we need to compare the content of 2 identical gridviews and extract rows that
I need help with comparing two files in makefile. I need something like this:
Need help to convert code from asp control to input type to fetch file
Need help with deleting call log from multi numbers, using the following code i
Need help on this following code. the problem is it only trigger the last

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.