Android SQLite ON UPDATE CASCADE not working
Please help me
These are my tables
String tablausuariocreate="CREATE TABLE IF NOT EXISTS USUARIO(" +
"idusuario INTEGER PRIMARY KEY NOT NULL," +
"DELETED BOOLEAN DEFAULT(0))";
String tablazonacreate="CREATE TABLE IF NOT EXISTS ZONA(" +
"IDZ INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," +
"NAME VARCHAR(150)," +
"idusuario integer," +
"DELETED BOOLEAN DEFAULT(0)," +
"FOREIGN KEY(idusuario) REFERENCES USUARIO(idusuario) on update cascade)";
String tablaclientecreate = "CREATE TABLE IF NOT EXISTS CLIENTE(" +
"IDC INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," +
"NAME VARCHAR(50) UNIQUE," +
"IDZ INTEGER," +
"idusuario integer," +
"DELETED BOOLEAN DEFAULT(0)," +
"FOREIGN KEY(IDZ) REFERENCES ZONA(IDZ) on delete set null on update cascade," +
"FOREIGN KEY(idusuario) REFERENCES USUARIO(idusuario) on update cascade )";
Aucun commentaire:
Enregistrer un commentaire