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 9123033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:14:32+00:00 2026-06-17T06:14:32+00:00

SOLVED. I just can’t accept the answer until 2 days has passed. Turned out

  • 0

SOLVED. I just can’t accept the answer until 2 days has passed. Turned out that sqliteman was reading an old database after all.

I’m trying to read from the database in Android but I don’t get any results. The weird thing is that when I run the exact same query on the same database in sqliteman(a sqlite manager) it works perfectly.

My query in my DB-handler class:

//exact same as in code
String fetchVaccinesForCountryQuery = 
     "SELECT v._id, v.vname, v.text " +
     "FROM vaccine v, vacc_disease vc " + 
     "WHERE v._id = vc.vaccineId and vc.diseaseId IN (SELECT cd.diseaseId " +
                                                     "FROM country_disease cd " +
                                                     "WHERE cd.countryId = %d)";

//and a version that's a bit easier to read...
String fetchVaccinesForCountryQuery = 
   "SELECT v._id, v.vname, v.text
    FROM vaccine v, vacc_disease vc
    WHERE v._id = vc.vaccineId and vc.diseaseId 
         IN (SELECT cd.diseaseId
         FROM country_disease cd
         WHERE cd.countryId = %d)";

public Cursor fetchVaccinesForCountry(long countryId) {
    String query = String.format(fetchVaccinesForCountryQuery, countryId);
    Log.d("TripDb", "fetchStr: " + query);
    return mDb.rawQuery(query, null);
}

I’ve written an info provider that calls that function:

Cursor c = mDb.fetchVaccinesForCountry(countryId);
Log.d("InfoProvider", "numVaccines = " + c.getCount());

The logcat string showing the query looks like this:

fetchStr: SELECT v._id, v.vname, v.text FROM vaccine v, vacc_disease vc WHERE v._id = vc.vaccineId and vc.diseaseId IN (SELECT cd.diseaseId FROM country_disease cd WHERE cd.countryId = 3)

While the Logcat showing number is

numVaccines = 0

But when I pull the database with adb and run the same query in SqliteMan I get 7 results. I’m kind of stumped as to why Android doesn’t give me 7 results.

  • 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-17T06:14:33+00:00Added an answer on June 17, 2026 at 6:14 am

    So…this is slightly embarrasing. It turned out that when I thought SqliteMan reloaded the database it was using an old file. Once I discovered that I could starting hunting the real error and now everything’s working…

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

Sidebar

Related Questions

I got so annoying problem, that can't be solved by just googling for me
I've got abit of a strange problem, that I just can't seem to solve!
This is not exactly a straight-out question because I have just solved it, but
I'm struggling with an array problem that I'm sure has been solved before. The
I've got some issues with a .htaccess that I just can't get to work.
Probably some simple derp but I just can't figure this out, I'm using almost
I just can't figure out how to upload images in django. I've read dozens
I was just wondering how you can use and adjacency matrix to solve graph
I just solved a problem I was having putting the Set keyword in a
I just solved the first problem from Project Euler in JavaFX for the fun

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.