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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:06:18+00:00 2026-06-13T12:06:18+00:00

I’ve made an Adnroid program in Eclipse that reads a csv file and inputs

  • 0

I’ve made an Adnroid program in Eclipse that reads a csv file and inputs the info into an SQLite database, and using

dbCursor = database.query(DATABASE_TABLE, new String[]{KEY_ROWID, KEY_ITEMTYPE, KEY_QUANTITY},  null, null, null, null, null);  

    int iRow = dbCursor.getColumnIndex(KEY_ROWID);
    int iType = dbCursor.getColumnIndex(KEY_ITEMTYPE);
    int iQuantity = dbCursor.getColumnIndex(KEY_QUANTITY);

        for(dbCursor.moveToFirst(); !dbCursor.isAfterLast(); dbCursor.moveToNext()){
            allData = allData + " " + dbCursor.getString(iRow) + "\t " + dbCursor.getString(iType) + "\t\t\t " + dbCursor.getString(iQuantity) + "\n";      
        }

and then printing out allData in a textview box has worked just fine.

Then I wanted to use

dbCursor = database.rawQuery("SELECT KEY_ROWID , SUM(KEY_ITEMTYPE) FROM DATABASE_TABLE GROUP BY KEY_ROWID", null);          
for(dbCursor.moveToFirst(); !dbCursor.isAfterLast(); dbCursor.moveToNext()){

    allDataSum = allDataSum + " " + dbCursor.getString(0);
} //I know this will probably not print what I want correctly but that's a problem for another day

When I try to print this I get the error “10-25 22:06:35.016: I/Database(1911): sqlite returned: error code = 1, msg = no such table: DATABASE_TABLE”.

I then opened DDMS File Explorer and copied the database onto my desktop and then tried viewing the database with a command tool but again got an error, “SQL error: no such table: inventory”.

How can the emulator show me what I want to see from .query() (but not from .rawQuery) when apparently there is no table in the database? Everything about I use the query and rawQuery is identical, so it’s not a case of not opening the db for rawQuery or something like that.

  • 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-13T12:06:18+00:00Added an answer on June 13, 2026 at 12:06 pm

    It appears that you’re using a static variables named DATABASE_TABLE, KEY_ROWID, and KEY_ITEMTYPE containing your actual names. When you use this with rawQuery, you’ll have to do

    dbCursor = database.rawQuery("SELECT " + KEY_ROWID + ", SUM(" + KEY_ITEMTYPE + ") FROM " + DATABASE_TABLE + " GROUP BY " + KEY_ROWID, null);
    

    Notice that when you make the query using database.query you don’t have these variables in quotes, that’s why it works.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.