小编ksh*_*f_x的帖子

我们如何在sqlite中删除外键?

我正在使用SQLite数据库.我有一个表,其中包含2个其他表的主键作为外键; 我想删除其中一个.这是表的代码:

protected static final String Item_places=(" CREATE TABLE " 
    + Item_place + "(" 
    + place_id + " INTEGER ," 
    + Item_id + " INTEGER  ," 
    + "FOREIGN KEY("+place_id+ ") REFERENCES " + PlaceTable + "("+ PlaceID+ " ) ON DELETE CASCADE" 
    + "FOREIGN KEY("+Item_id+ ") REFERENCES "+ contentTable+ "("+contentID+"));"); 
Run Code Online (Sandbox Code Playgroud)

sqlite android

4
推荐指数
2
解决办法
6062
查看次数

标签 统计

android ×1

sqlite ×1