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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:50:24+00:00 2026-06-14T02:50:24+00:00

im new on Android. I have some trouble with the insert statement in the

  • 0

im new on Android. I have some trouble with the insert statement in the database, when im running the application the values have not been inserted. Please someone can help..

public class DatabaseAdapter extends SQLiteOpenHelper {
// Database attributes
public static final String DB_NAME = "MoneyManagerSystemTr";
public static final int DB_VERSION = 1;

// Table attributes

public static final String TABLE_ACCOUNT = "account_table";

//Account Table
public static final String KEY_BANKNAME ="bankname";
public static final String KEY_TYPE = "type";
public static final String KEY_ACCNUM = "accnum";
public static final String KEY_BALANCE = "balance";
public static final String KEY_EXPIRYDATE = "expirydate";

@Override
public void onCreate(SQLiteDatabase db) {


    String AccountTable = "create table if not exists " + TABLE_ACCOUNT + " ( " + BaseColumns._ID + " integer primary key autoincrement, " 
            + KEY_BANKNAME + " text not null, "
            + KEY_TYPE + " text, "
            + KEY_ACCNUM + " text, "
            + KEY_BALANCE + " text, "
            + KEY_EXPIRYDATE + " text);";

    db.execSQL(AccountTable);

String ROW1 = "INSERT INTO " + TABLE_ACCOUNT + " Values ('Cash','','',0, '');";
    db.execSQL(ROW1);

    String ROW2 = "INSERT INTO " + TABLE_ACCOUNT + " Values ('Bank Account','','',0, '');";
    db.execSQL(ROW2);

    String ROW3 = "INSERT INTO " + TABLE_ACCOUNT + " Values ('Credit Card','','',0, '');";
    db.execSQL(ROW3);
  • 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-14T02:50:25+00:00Added an answer on June 14, 2026 at 2:50 am

    Remove the semicolons from your insert statements and add quotes around 0:

    String ROW1 = "INSERT INTO " + TABLE_ACCOUNT + " ("
                  + KEY_BANKNAME + ", " + KEY_TYPE + ", "
                  + KEY_ACCNUM + ", " + KEY_BALANCE + ", "
                  + KEY_EXPIRYDATE + ") Values ('Cash', '', '', '0', '')";
    db.execSQL(ROW1);
    

    Better yet, heed the suggestion at execSQL() and use insert() instead.

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

Sidebar

Related Questions

I am a bit new with android but I have some java experience. So
i am creating a new android application.i am using the table layout. I have
I am new to Android. I have tried an sample application for status bar
I'm brand new to Android dev and have some n00b questions about AVD. Is
I am new to the android api and I have some problems with ..
I defined a new Activity on my project and I have some trouble with
Been having some trouble trying to integrate the admob sdk into my application to
Having some trouble passing values from one class to another. I basically have a
I'm new to Android development and have some question regarding overlays in googlemaps API.
I'm new to Android development and have some question regarding overlays in googlemaps API.

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.