开发者

sqlitedatabase update

开发者 https://www.devze.com 2023-02-18 09:03 出处:网络
I\'m currently trying to update a row using the sqlitedatabase.update method here: Heres the cod开发者_如何学Goe that I have:

I'm currently trying to update a row using the sqlitedatabase.update method here:

Heres the cod开发者_如何学Goe that I have:

public int udpateStockInfo(String stock, double qty, double purchasePrice){
    ContentValues val = new ContentValues();
    val.put(KEY_QTY, qty);
    val.put(KEY_PURCHASE_PRICE, purchasePrice);

    return db.update(DB_TABLE, val, KEY_STOCKNAME + "=?", new String[]{stock});  
}

Right now I'm getting an error on the last return line. Can anyone help me with it? The IDE is saying there is a syntax error on tokens, misplaced constructs.


as noted above gotta make sure its' a new String[]

0

精彩评论

暂无评论...
验证码 换一张
取 消