Trigger to delete blank rows after INSERT

samdot

New Member
I have inserted a set of data into a database, now I want to delete all the rows with blank values. How can I do this? Can this be done using triggers?Example:table BOOKS contains \[code\]author_name\[/code\], \[code\]title\[/code\], \[code\]price\[/code\].After inserting data, I want to delete all the rows with empty values in the \[code\]author_name\[/code\] column. Here's what I've written so far:\[code\]CREATE TRIGGER trigger1 AFTER INSERT ON BOOKS FOR EACH ROW BEGIN DELETE FROM BOOKS WHERE author_name = '' END;\[/code\]This is not working :(
 
Top