dimanche 1 mars 2015

ON DELETE CASCADE not deleting entry for foreign key


I am running the below query in ideone


CREATE TABLE AUTHOR ( AUTHOR_ID NUMBER(5) PRIMARY KEY, AUTHOR_NAME VARCHAR2(18) );


CREATE TABLE BOOK ( BOOK_ID NUMBER(5) PRIMARY KEY, BOOK_NAME VARCHAR2(15), AUTHOR_ID NUMBER(5), CONSTRAINT author_fk FOREIGN KEY (AUTHOR_ID) REFERENCES AUTHOR(AUTHOR_ID) ON DELETE CASCADE );


After creating some entries, when I try to delete the entries in AUTHOR Table the corresponding entry in BOOK is not deleted.


Can someone help me what I am doing wrong.


Thanks,





Aucun commentaire:

Enregistrer un commentaire