android编译sqlite,android-SQLite插入引发语法异常

我从SQLite收到此错误,

靠近“,”:语法错误(代码1):,而在编译时:

UPDATE OutfitItem

SET outfit_img_relative_pos_x=?,clothing_item_ID=?,outfit_img_relative_pos_y=?,

outfit_img_relative_size_width=?,outfit_ID=?,outfit_img_relative_size_height=?

WHERE (outfit_ID,clothing_item_ID) = (60,5)

有人可以为我找出错误吗?

以下是被编译的代码…

// ---updates a outfitItem---

public boolean update(long outfitID, long clothingItemID, double imgRelativePos_X, double imgRelativePos_Y,

double imgRelativeSize_width, double imgRelativeSize_height)

{

ContentValues args = new ContentValues();

args.put(KEY_OUTFIT_ID, outfitID);

args.put(KEY_CLOTHING_ITEM_ID, clothingItemID);

args.put(KEY_OUTFIT_IMAGE_RELATIVE_POS_X, imgRelativePos_X);

args.put(KEY_OUTFIT_IMAGE_RELATIVE_POS_Y, imgRelativePos_Y);

args.put(KEY_OUTFIT_IMAGE_RELATIVE_SIZE_WIDTH, imgRelativeSize_width);

args.put(KEY_OUTFIT_IMAGE_RELATIVE_SIZE_HEIGHT, imgRelativeSize_height);

return db.update(TABLE_NAME, args, "(" + KEY_OUTFIT_ID + "," + KEY_CLOTHING_ITEM_ID + ") = (" + outfitID

+ "," + clothingItemID + ")", null) > 0;

}

以下是创建表的代码,并注意将外键设置为on …

public static final String TABLE_NAME = "OutfitItem";

public static final String TABLE_CREATE = "create table " + TABLE_NAME + "(" + KEY_OUTFIT_ID

+ " int not null REFERENCES " + Table_Outfit.TABLE_NAME + "(" + KEY_OUTFIT_ID + ") ON DELETE CASCADE,"

+ KEY_CLOTHING_ITEM_ID + " int not null REFERENCES " + Table_ClothingItem.TABLE_NAME + "("

+ KEY_CLOTHING_ITEM_ID + ") ON DELETE CASCADE, " + KEY_OUTFIT_IMAGE_RELATIVE_POS_X + " real not null, "

+ KEY_OUTFIT_IMAGE_RELATIVE_POS_Y + " real not null, " + KEY_OUTFIT_IMAGE_RELATIVE_SIZE_WIDTH

+ " real not null, " + KEY_OUTFIT_IMAGE_RELATIVE_SIZE_HEIGHT + " real not null, " + "primary key ("

+ KEY_OUTFIT_ID + "," + KEY_CLOTHING_ITEM_ID + "));";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值