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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:09:27+00:00 2026-06-08T23:09:27+00:00

When I query my database I keep getting an error saying SQLException: no such

  • 0

When I query my database I keep getting an error saying SQLException: no such column and i do not understand why when my query looks just fine

Cursor nameCursor = context.getContentResolver().query(StatusList.STATUS_URI,new String[] {StatusList.STATUS_NAME,StatusList.STATUS_PERMISSIONS,StatusList.STATUS_ECM2ID}
                ,StatusList.STATUS_TYPE+"=1"+" AND "+StatusList.STATUS_NAME+"="+incidentCursor.getString(0),null,null);

here is the full error

08-01 15:39:59.104: W/System.err(8623): android.database.sqlite.SQLiteException: no such column: SIS (code 1): , while compiling: SELECT name, permissions, ecm2id FROM Status WHERE (type=1 AND name=SIS)
08-01 15:39:59.112: W/System.err(8623):     at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
08-01 15:39:59.112: W/System.err(8623):     at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:493)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
08-01 15:39:59.120: W/System.err(8623):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
08-01 15:39:59.128: W/System.err(8623):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:400)
08-01 15:39:59.128: W/System.err(8623):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:294)
08-01 15:39:59.128: W/System.err(8623):     at ecm2.android.Providers.StatusList.query(StatusList.java:132)
08-01 15:39:59.128: W/System.err(8623):     at android.content.ContentProvider.query(ContentProvider.java:652)
08-01 15:39:59.128: W/System.err(8623):     at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
08-01 15:39:59.128: W/System.err(8623):     at android.content.ContentResolver.query(ContentResolver.java:370)
08-01 15:39:59.135: W/System.err(8623):     at android.content.ContentResolver.query(ContentResolver.java:313)
08-01 15:39:59.135: W/System.err(8623):     at ecm2.android.MainActivity.createNewDialog(MainActivity.java:1167)
08-01 15:39:59.135: W/System.err(8623):     at ecm2.android.MainActivity$ListViews.onListItemClick(MainActivity.java:641)
08-01 15:39:59.135: W/System.err(8623):     at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
08-01 15:39:59.135: W/System.err(8623):     at android.widget.AdapterView.performItemClick(AdapterView.java:298)
08-01 15:39:59.135: W/System.err(8623):     at  android.widget.AbsListView.performItemClick(AbsListView.java:1086)
08-01 15:39:59.143: W/System.err(8623):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:2855)
08-01 15:39:59.143: W/System.err(8623):     at android.widget.AbsListView$1.run(AbsListView.java:3529)
08-01 15:39:59.143: W/System.err(8623):     at android.os.Handler.handleCallback(Handler.java:615)
08-01 15:39:59.143: W/System.err(8623):     at android.os.Handler.dispatchMessage(Handler.java:92)
08-01 15:39:59.143: W/System.err(8623):     at android.os.Looper.loop(Looper.java:137)
08-01 15:39:59.143: W/System.err(8623):     at android.app.ActivityThread.main(ActivityThread.java:4745)
08-01 15:39:59.143: W/System.err(8623):     at java.lang.reflect.Method.invokeNative(Native Method)
08-01 15:39:59.151: W/System.err(8623):     at java.lang.reflect.Method.invoke(Method.java:511)
08-01 15:39:59.151: W/System.err(8623):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-01 15:39:59.151: W/System.err(8623):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-01 15:39:59.151: W/System.err(8623):     at dalvik.system.NativeStart.main(Native Method)

Basically what I am trying to do it query my database for anything of type 1 and a name

I know for a fact such record exists so I dont know why I am getting this error

EDIT:
Database creation code

private static class DatabaseHelper extends SQLiteOpenHelper 
{
    DatabaseHelper(Context context) 
    {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) 
    {
        createTables(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, 
                          int newVersion) 
    {
        Log.w("Messages", "Upgrading database from version " + oldVersion 
              + " to "
              + newVersion + ", which will destroy all old data");
        db.execSQL("DROP TABLE IF EXISTS Incidents");
        db.execSQL("DROP TABLE IF EXISTS Distributions");
        onCreate(db);
    }

    private void createTables(SQLiteDatabase db){
        db.execSQL("CREATE TABLE " + INCIDENTS_TABLE + "(" + INCIDENT_ID + " integer primary key autoincrement, " +
                INCIDENT_ECM2ID + " INTEGER, " + INCIDENT_STATON_NAME + " TEXT, " + INCIDENT_READ + " INTEGER, " + INCIDENT_TOC + " TEXT, " +
                INCIDENT_STATION_ID + " INTEGER, " + INCIDENT_MESSAGE_ID + " INTEGER, " + INCIDENT_MESSAGE + " TEXT);");

        db.execSQL("CREATE TABLE " + DISTRIBUTION_MESSAGES_TABLE + "(" + DIST_ID + " integer primary key autoincrement, " +
                DIST_MESSAGE_ID + " INTEGER, " + DIST_ECM2ID + " INTEGER, " + DIST_SENDER_EMAIL + " TEXT, " + 
                DIST_SENDER_NAME + " TEXT, " + DIST_STATION_ID + " INTEGER, " + DISC_READ + " INTEGER, " + DIST_TOC + " TEXT, "
                + DIST_SUBJECT +" TEXT, " + DIST_MESSAGE + " TEXT);");
    }
}
  • 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-08T23:09:28+00:00Added an answer on June 8, 2026 at 11:09 pm

    SIS is not a column, it should be a string. Either use the ? substitution character or wrap your string in quotes.

    Using SQL injection safe ?:

    Cursor nameCursor = context.getContentResolver().query(StatusList.STATUS_URI,
            new String[] {StatusList.STATUS_NAME, StatusList.STATUS_PERMISSIONS, StatusList.STATUS_ECM2ID},
            StatusList.STATUS_TYPE + "=1 AND " + StatusList.STATUS_NAME + "=?",
            new String[] {incidentCursor.getString(0)},
            null);
    

    Using quotes:

    Cursor nameCursor = context.getContentResolver().query(StatusList.STATUS_URI,
            new String[] {StatusList.STATUS_NAME, StatusList.STATUS_PERMISSIONS, StatusList.STATUS_ECM2ID},
            StatusList.STATUS_TYPE + "=1 AND " + StatusList.STATUS_NAME + "='" + incidentCursor.getString(0) + "'",
            null,
            null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to insert into sql database however i keep getting an error
I have imported a PostgreSQL database and I keep getting this error: ERROR: operator
So i keep getting this error when trying to connect to my database remotely.
Hey there -- Doing a simple TIMESTAMPDIFF query and I keep getting an error
I keep getting this error, and I'm not really sure why this isn't working
I keep getting this error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'mcabinet'@'localhost' (using
Hi i am trying to run a query on a database, but i keep
I am trying to query the database as such because of a rails3-jquery-autocomplete gem
I'm trying to query a database view that's not located on the same server
In this code I keep getting an error, I know its how I'm saving

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.