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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:41:22+00:00 2026-06-15T12:41:22+00:00

my android app is crashing with this exception 12-02 12:40:50.145: E/AndroidRuntime(531): Caused by:android.database.sqlite.SQLiteException: near

  • 0

my android app is crashing with this exception

12-02 12:40:50.145: E/AndroidRuntime(531): Caused by:android.database.sqlite.SQLiteException: near "(": syntax error: , while compiling: insert into target(username, (password, (lastLogin, (numberOfLogins, (status, (endpoint) values (?,?,?,?,?,?)

My insert statement in the code looks like this

private static final String INSERT = "insert into " + AttachmentTable.TABLE_NAME 
                                        + " (" + AttachmentColumns.STATUS + ", "
                                        + AttachmentColumns.RETRIES + ", "
                                        + AttachmentColumns.ATT_URI + ", "
                                        + AttachmentColumns.ATT_URI_SOURCE + ", "
                                        + AttachmentColumns.COMMENT+ ", "
                                        + AttachmentColumns.ADDED + ", "
                                        + AttachmentColumns.LAST_RETRY + ", "
                                        + AttachmentColumns.FINISHED + ") " +
                                        "values (?,?,?,?,?,?,?,?)";

In the code I tried to save one of the created attachments. But it does not work. In the Android File Explorer I could see that the database has been created. Here the save part from my code

DataManager data = new DataManagerImpl(this);
    Attachment att = new Attachment();
    att.setAdded("now");
    att.setAttUri("test");
    att.setAttUriSource("test");
    att.setComment("test");
    att.setLastRetry("test");
    att.setRetries(3);
    att.setStatus(0);
    data.setAttachment(att);

And here the setAttachment code

@Override
public boolean setAttachment(Attachment t) {
    boolean retVal = false;
    try{
        db.beginTransaction();
        long result = attDao.save(t);
        if (result != -1)
            retVal = true;

    }catch (SQLException e) {
        Log.e(TAG, "Exception during saving target " + e.getMessage() + " rolling back transaction");
    } finally{
        db.endTransaction();
    }
    return retVal; 

}
  • 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-15T12:41:23+00:00Added an answer on June 15, 2026 at 12:41 pm

    to insert just do this

    ContentValues values = new ContentValues();
        values.put(AttachmentColumns.STATUS, "hello");
        values.put(AttachmentColumns.ATT_URI, "uri");
                 ...
    

    and

    db.insert(TABLE_NAME, null /* nullColumnHack */,
                    values);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Android app is crashing with this error: E/AndroidRuntime( 315): Caused by: android.database.sqlite.SQLiteException: bind
I have an Android app that is crashing with the following error. Caused by:
my android app crash before load main.xml. This is the exception thrown java.lang.RuntimeException: Unable
My Android App has a products table in an SQLite database that comes pre-populated
My Android app has an SQLite database table with entries as follows: USER_ID |
I have an Android app which is crashing on some phones, and not on
The android app reads from database but doesnt write anything to DB, the app
This link describes my problem exactly: http://old.nabble.com/Android-database-corruption-td28044218.html#a28044218 There are about 300 people using my
I think my android app is leaking memory. I'm not absolutely sure that this
My new Android app is crashing when I run it on my phone, but

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.