1. Check out our companion app, Forums for Android! Download from Google Play

is it better to use delete or upgrade to delete data in rows

Discussion in 'Application Development' started by flyhigh427, Jul 10, 2013.

  1. flyhigh427

    flyhigh427 Well-Known Member
    Thread Starter
    16

    Jan 10, 2013
    53
    1
    16
    if row_id goes from top to bottom and columns go left to right
    i dont want to delete the row only all data .
    is it better to use delete or upgrade?


    column1|column2|column3
    1 items | name1 |name2
    2
    3
    4
    5
    is there a way to delete name1 and name2 without deleteing any rows?

    i have some code ive been tring but it doesnt work.


    Code (Text):
    1.  
    2. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]public[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] updatenotdelete([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]long[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] rowId, String item, String have, String need, String got, String store, String cost) {
    3. ContentValues args = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ContentValues();
    4. [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// args.put(KEY_ITEMS, item);[/LEFT]
    5. [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]args.put([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_HAVE[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], have);
    6. args.put([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_NEED[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], need);
    7. args.put([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_GOT[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], got);
    8. args.put([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_STORE[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], store);
    9. args.put([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_COST[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], cost);
    10.  
    11. [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]mDb[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].update([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]DATABASE_TABLE[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], args, [/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]KEY_ROWID[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"="[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + rowId, [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) > 0;[/LEFT]
    12. }
    13. [/SIZE]
    14.  
    15. [code]
     

    Advertisement

  2. flyhigh427

    flyhigh427 Well-Known Member
    Thread Starter
    16

    Jan 10, 2013
    53
    1
    16
    update seems better i think
     

Share This Page

Loading...