But though i changed Before into after Nothing happened.I want to see the output of the result how just after inserted new value regarding the query.... :(
dili1234
Posts
-
About Triggers -
About TriggersThis is my first time of creating trigger..I tried to create trigger using mysql to count how many 2007 data in the table when inserting new record but it not working properly it not showing outout as 50....... My table have more than 50 data... CREATE TRIGGER No_of_Publisher_year Before Insert ON Book FOR EACH ROW SET @Count_No=New.Copyright; SET @Count_NO=0; INSERT INTO Book VALUES(14,'Programming Perl','978-0-201-70073-2','WI','2007-12-11',25.23,2,2007); SELECT Count(@Count_NO) AS 'No_of_publisher_in_year_2007' FROM Book WHERE Copyright=2007
-
About TriggersThis is my first time of creating a trigger..I tried to create trigger using mysql to count how many "2007" data are in the table when inserting new record but it not working properly it wont display how 2007 data are in my table....... My table have more than 50 data... CREATE TRIGGER No_of_Publisher_year Before Insert ON Book FOR EACH ROW SET @Count_No=New.Copyright; SET @Count_NO=0; INSERT INTO Book VALUES(14,'Programming Perl','978-0-201-70073-2','WI','2007-12-11',25.23,2,2007); SELECT Count(@Count_NO) AS 'No_of_publisher_in_year_2007' FROM Book WHERE Copyright=2007