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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:49:44+00:00 2026-05-28T14:49:44+00:00

`// * ** * ** * ** * ** * ** Error showing in

  • 0

`// *************** Error showing in Logcat ******
android.database.sqlite.SQLiteException: no such column: me: , while compiling: UPDATE TemplateTable SET user=?, alert=?, mycard=? WHERE user=me

//***************** Settings Activity *************

Button save=(Button) findViewById(R.id.save_templates);
save.setOnClickListener(new View.OnClickListener() {

        public void onClick(View arg0) {
            // TODO Auto-generated method stub

            // Save templates selected 
            CardsDatabase db = new CardsDatabase(Settings.this);
            db.open();
            ContentValues cv=new ContentValues();
            cv.put(CardsDatabase.USERTEMPLATE, "me");
            cv.put(CardsDatabase.ALERT, Integer.toString(alert));
            cv.put(CardsDatabase.MYCARD, Integer.toString(mycard));
            db.updateTemplate(cv);
            db.close();

            Toast.makeText(Settings.this, "Settings saved successfully.", Toast.LENGTH_SHORT).show();

        }
    }); 

//****************** Database class****************

public class CardsDatabase {

public static String USERTEMPLATE = "user";
public static String MYCARD = "mycard";
public static String ALERT = "alert";

public static String USER = "user";
public static String NAME = "name";
public static String COMPANY = "company";
public static String TITLE = "title";
public static String ADDRESS = "address";
public static String PHONE = "phone";
public static String CEL = "cel";
public static String EMAIL = "email";
public static String PHOTO = "photo";

public static String MAC = "macaddress";

private static String DATABASE_NAME = "CardsDatabase";
public static String DATABASE_TABLE_TEMPLATE = "TemplateTable";
public static String DATABASE_TABLE_MYTABLE = "MYTable";
public static String DATABASE_TABLE_CONTACTS = "ContactsTable";

private static int DATABASE_VERSION = 1;

private DbHelper ourHelper;
private final Context ourContext;
private SQLiteDatabase ourDatabase;

private static class DbHelper extends SQLiteOpenHelper {

    public DbHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        // Log.d(Tag,"Inner on create called");
        db.execSQL("CREATE TABLE " + DATABASE_TABLE_TEMPLATE + " ("
                + USERTEMPLATE + " TEXT NOT NULL," + MYCARD
                + " TEXT NOT NULL," + ALERT + " TEXT NOT NULL" + ");");

        db.execSQL("CREATE TABLE " + DATABASE_TABLE_MYTABLE + " (" + USER
                + " TEXT NOT NULL," + NAME + " TEXT NOT NULL," + COMPANY
                + " TEXT," + TITLE + " TEXT," + ADDRESS + " TEXT," + PHONE
                + " TEXT NOT NULL," + CEL + " TEXT," + EMAIL
                + " TEXT NOT NULL," + PHOTO + " BLOB" + ");");

        db.execSQL("CREATE TABLE " + DATABASE_TABLE_CONTACTS + " (" + MAC
                + " TEXT NOT NULL" + ");");
    }

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

}

public CardsDatabase(Context c) {
    ourContext = c;
}

public CardsDatabase open() throws SQLException {
    ourHelper = new DbHelper(ourContext);
    ourDatabase = ourHelper.getWritableDatabase();
    return this;
}

public void close() {
    ourHelper.close();
}

public void createEntry(int type, ContentValues cv) {
    // TODO Auto-generated method stub

    switch (type) {
    case 1:
        ourDatabase.insert(DATABASE_TABLE_TEMPLATE, null, cv);
        break;
    case 2:
        ourDatabase.insert(DATABASE_TABLE_MYTABLE, null, cv);
        break;
    case 3:
        ourDatabase.insert(DATABASE_TABLE_CONTACTS, null, cv);
        break;
    }

}

public Cursor getTemplate() throws SQLException {
    // TODO Auto-generated method stub

    String[] columns = new String[] { USERTEMPLATE, MYCARD, ALERT };

    Cursor c = ourDatabase.query(DATABASE_TABLE_TEMPLATE, columns, null,
            null, null, null, null);

    return c;
}

public Cursor getMyData() throws SQLException {
    // TODO Auto-generated method stub

    String[] columns = new String[] { USER, NAME, COMPANY, TITLE, ADDRESS,
            PHONE, CEL, EMAIL, PHOTO };

    Cursor c = ourDatabase.query(DATABASE_TABLE_MYTABLE, columns, null,
            null, null, null, null);

    return c;
}

public boolean contactExist(String mac) throws SQLException {
    // TODO Auto-generated method stub

    String[] columns = new String[] { MAC };

    Cursor c = ourDatabase.query(DATABASE_TABLE_CONTACTS, columns, MAC
            + "=" + mac, null, null, null, null);

    return c.getCount() > 0 ? true : false;
}

public void updateTemplate(ContentValues cv) {
    String m = "me";
    ourDatabase.update(DATABASE_TABLE_TEMPLATE, cv, USERTEMPLATE + "=" + m,
            null);
}

public void updateMytable(ContentValues cv) {
    String m = "me";
    ourDatabase.update(DATABASE_TABLE_MYTABLE, cv, USER + "=" + m, null);
}

}`

  • 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-28T14:49:45+00:00Added an answer on May 28, 2026 at 2:49 pm

    You need to provide more details, but I’d be willing to bet you updated your schema without incrementing your version number in your SQLiteOpenHelper implementation.

    EDIT

    After looking through your code, you need to add single quotes to your WHERE clause in the update method. If you don’t use quotes, the db engine treats it as a column in your table, hence the error “no such column: me”

    You have:

    public void updateTemplate(ContentValues cv) {
        String m = "me";
        ourDatabase.update(DATABASE_TABLE_TEMPLATE, cv, USERTEMPLATE + "=" + m,
                null);
    }
    

    should be something like:

    public void updateTemplate(ContentValues cv) {
        String m = "me";
        String WHERE = String.format("%s='%s'", USERTEMPLATE, m);
        ourDatabase.update(DATABASE_TABLE_TEMPLATE, cv, WHERE, null);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if anyone can help - I have this error showing recently when
Ok the error is showing up somewhere in this here code if($error==false) { $query
Hi i have a debian server. Today my site was showing Error establishing a
I am try to bind the dropdowmlist using jquery. But is showing some error.
it is showing me following error when i m opening http://localhost:3000/store **We're sorry, but
A web page of a web application was showing a strange error. I regressively
I just want to see error insteas of asp.net showing me default error Server
Logcat output: [2010-01-09 15:47:19 - HelloMapView]------------------------------ [2010-01-09 15:47:19 - HelloMapView]Android Launch! [2010-01-09 15:47:19 -
I am new to android world. I have made an application of a user
I am posting here a logcat file. How can I solve the runtimeException error.

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.