mercredi 3 février 2016

Is there something like "ON DELETE NULL" for Android SQLite?

I have two tables:

 create table notes (_id integer primary key autoincrement, "
                + "title text not null, body text not null, category text," +
                " foreign key(category) references categories(title) on delete null);

create table categories (_id integer primary key autoincrement, "
                + "title text unique not null);

I'm wondering if there's something like ON DELETE CASCADE but instead of deleting the content, changing it to NULL

Obviously ON DELETE NULL does not work.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire