Example usage for android.database.sqlite SQLiteDatabase delete

List of usage examples for android.database.sqlite SQLiteDatabase delete

Introduction

In this page you can find the example usage for android.database.sqlite SQLiteDatabase delete.

Prototype

public int delete(String table, String whereClause, String[] whereArgs) 

Source Link

Document

Convenience method for deleting rows in the database.

Usage

From source file:Main.java

public static void deleteComment(long companyId, SQLiteDatabase db) {
    db.delete(COMMENT_TABLE_NAME, COMMENT_COMPANY_ID + "=" + Long.toString(companyId), null);
}

From source file:Main.java

public static void deleteAll(SQLiteDatabase db, String name) {
    db.delete(name, null, null);
}

From source file:Main.java

public static void cleanTable(SQLiteDatabase mDB, String tableName) {
    mDB.delete(tableName, null, null);
}

From source file:Main.java

public static Integer deleteFilter(SQLiteDatabase db, Integer id) {
    return db.delete(TABLE_NAME, COLUMN_FILTER_ID + " = ? ", new String[] { Integer.toString(id) });
}

From source file:Main.java

public static Integer deleteItem(SQLiteDatabase db, Integer id) {
    return db.delete(TABLE_NAME, COLUMN_ID + " = ? ", new String[] { Integer.toString(id) });
}

From source file:Main.java

public static boolean delete(SQLiteDatabase db, String key, String value) {
    return db.delete(TABLE_NAME, FIELD_SET_NAME + "= ?," + FIELD_VALUE + "=?", new String[] { key, value }) == 0
            ? false/*  w  w w. j  av  a2 s  .  c  o  m*/
            : true;
}

From source file:Main.java

public static int delete(SQLiteDatabase db, String pageId, String lang) {
    return db.delete(TABLE_CONTENT_HELP, PAGE_ID + "=? AND " + PAGE_LANGUAGE + "=?",
            new String[] { pageId, lang });
}

From source file:Main.java

public static void resetAutoIncrement(SQLiteDatabase db, String name) {
    String[] whereArgs = { name };
    db.delete("sqlite_sequence", "name = ?", whereArgs);
}

From source file:Main.java

public static int delete(SQLiteDatabase db, String name, int id) {
    String[] whereArgs = { String.valueOf(id) };
    return db.delete(name, "id = ?", whereArgs);
}

From source file:com.contentful.vault.SqliteHelper.java

static void clearRecords(SpaceHelper helper, SQLiteDatabase db) {
    db.beginTransaction();/*from  ww  w .j  a v a2 s.  c om*/
    try {
        db.delete(escape(TABLE_ENTRY_TYPES), null, null);
        db.delete(escape(TABLE_SYNC_INFO), null, null);
        for (String code : helper.getLocales()) {
            db.delete(escape(localizeName(TABLE_ASSETS, code)), null, null);
            db.delete(escape(localizeName(TABLE_LINKS, code)), null, null);

            for (ModelHelper<?> modelHelper : helper.getModels().values()) {
                db.delete(escape(localizeName(modelHelper.getTableName(), code)), null, null);
            }
        }
        db.setTransactionSuccessful();
    } finally {
        db.endTransaction();
    }
}