Execute update statement - Android Database

Android examples for Database:SQL Update

Description

Execute update statement

Demo Code


//package com.java2s;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    public static SQLiteDatabase db;
    public static String detailname = "detaillist";

    public static void modifyDetail(String defualtnumber,
            String modifynumber, String modifydetail, String modifymemo) {
        db.execSQL("update " + detailname + " set detail = '"
                + modifydetail + "' where number = '" + defualtnumber
                + "';");
        db.execSQL("update " + detailname + " set memo = '" + modifymemo
                + "' where number = '" + defualtnumber + "';");
        db.execSQL("update " + detailname + " set number = '"
                + modifynumber + "' where number = '" + defualtnumber
                + "';");
    }//  ww  w  .  j  av  a  2 s .co m
}

Related Tutorials