delete row from a table via table name and column name, and its value - Android Database

Android examples for Database:Table Row Delete

Description

delete row from a table via table name and column name, and its value

Demo Code

/**/*from w w  w. ja  v a  2s  . co m*/
 * Copyright (c) 2014, German Neuroinformatics Node (G-Node)
 * Copyright (c) 2014, Shumail Mohy-ud-Din <shumailmohyuddin@gmail.com>
 * Copyright (c) 2013, Yasir Adnan <adnan.ayon@gmail.com> 
 * License: BSD-3 (See LICENSE)
 */
//package com.java2s;

import android.database.sqlite.SQLiteDatabase;

import android.util.Log;

public class Main {
    public static SQLiteDatabase database;
    public static final String TABLE_ABSTRACT_FAVORITES = "ABSTRACT_FAVORITES";

    public static void deleteFromABSTRACT_FAVORITES(String abstract_uuid) {

        long rows_affected = database.delete(TABLE_ABSTRACT_FAVORITES,
                "ABSTRACT_UUID = ?", new String[] { abstract_uuid });
    }
}

Related Tutorials