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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:38:09+00:00 2026-05-29T17:38:09+00:00

I’m trying to make a database in android but I have this problem,erase the

  • 0

I’m trying to make a database in android but I have this problem,erase the database file in the (AVD), rename the database in the class “phone”, but nothing works!

02-11 13:00:27.491: E/Database(487): android.database.sqlite.SQLiteException: table Phones_Table has no column named nam: , while compiling: INSERT INTO Phones_Table(nam, tel) VALUES(?, ?);

this is my code:

public class Phones {
    public static final String ID_ROW = "_id";
public static final String ID_PERSON = "nam";
public static final String ID_PHONE = "tel";

private static final String N_DB = "Phones";
private static final String N_TABLE = "Phones_Table";
private static final int VERSION_DB = 1;

private DBHelper nHelper;
private final Context nContext;
private SQLiteDatabase nDB;



private static class DBHelper extends SQLiteOpenHelper{

    public DBHelper(Context context) {
        super(context, N_DB, null, VERSION_DB);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL("CREATE TABLE " + N_TABLE + "(" + 
        ID_ROW + " INTEGER PRIMARY KEY AUTOINCREMENT, "+
        ID_PERSON + "TEXT NOT NULL, "+
        ID_PHONE + "TEXT NOT NULL);"
        );

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("DROP TABLE IF EXISTS " + N_TABLE);
        onCreate(db);           
    }

}

public Phones (Context c){

    nContext = c;
}

public Phones open() throws SQLException{
    nHelper = new DBHelper(nContext);
    nDB = nHelper.getWritableDatabase();
    return this;
}

public void close() {
    // TODO Auto-generated method stub
    nHelper.close();
}

public long createEntry(String nam, String tel) {
    // TODO Auto-generated method stub
    //insert data
    ContentValues cv = new ContentValues();
    //put content of name
    cv.put(ID_PERSON, nam);
    //put content of Phone 
    cv.put(ID_PHONE, tel);

    //return content in table
    return nDB.insert(N_TABLE, null, cv);

}

public String receive() {
    // TODO Auto-generated method stub
    String[] columns = new String[]{ID_ROW, ID_PERSON, ID_PHONE};
    Cursor c = nDB.query(N_TABLE, columns, null, null, null, null, null);
    String result = "";

    int iRow = c.getColumnIndex(ID_ROW);
    int iName = c.getColumnIndex(ID_PERSON);
    int iPhone = c.getColumnIndex(ID_PHONE);
    //loop
    for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()){
        result = result + c.getString(iRow) + " " + c.getString(iName) + " " + c.getString(iPhone) + "\n ";

    }

    return result;
}}

really would appreciate your help

  • 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-05-29T17:38:13+00:00Added an answer on May 29, 2026 at 5:38 pm
    ID_PERSON + "TEXT NOT NULL, "+
                 ^
    

    You’re missing a space at the indicated position in the create table string. Same thing for the next line.

    Your table will have columns named namTEXT and telTEXT without that extra space.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a reasonable size flat file database of text documents mostly saved in
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
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
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to render a haml file in a javascript response like so:
I am trying to loop through a bunch of documents I have to put
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.