This does not work: CREATE OR REPLACE TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAFT SET AC_TTAF = AC_TTAF + NEW.CHAR_HOURS_FLOWN, AC_TTEL = AC_TTEL + NEW.CHAR_HOURS_FLOWN, AC_TTER = AC_TTER + NEW.CHAR_HOURS_FLOWN WHERE AIRCRAFT.AC_NUMBER = NEW.AC_NUMBER; END; I get the following error: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAF' at line 1 Here is the original question: Create a trigger named trg_char_hours that automatically updates the AIRCRAFT table when a new CHARTER row is added. Use the CHARTER table’s CHAR_HOURS_FLOWN to update the AIRCRAFT table’s AC_TTAF, AC_TTEL, and AC_TTER values. (Hint: use temp values, as the INSERT event does not accept the OLD keyword.)
This does not work: CREATE OR REPLACE TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAFT SET AC_TTAF = AC_TTAF + NEW.CHAR_HOURS_FLOWN, AC_TTEL = AC_TTEL + NEW.CHAR_HOURS_FLOWN, AC_TTER = AC_TTER + NEW.CHAR_HOURS_FLOWN WHERE AIRCRAFT.AC_NUMBER = NEW.AC_NUMBER; END; I get the following error: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAF' at line 1 Here is the original question: Create a trigger named trg_char_hours that automatically updates the AIRCRAFT table when a new CHARTER row is added. Use the CHARTER table’s CHAR_HOURS_FLOWN to update the AIRCRAFT table’s AC_TTAF, AC_TTEL, and AC_TTER values. (Hint: use temp values, as the INSERT event does not accept the OLD keyword.)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
This does not work:
CREATE OR REPLACE TRIGGER trg_char_hours
AFTER INSERT ON CHARTER
FOR EACH ROW
BEGIN
UPDATE AIRCRAFT
SET
AC_TTAF = AC_TTAF + NEW.CHAR_HOURS_FLOWN,
AC_TTEL = AC_TTEL + NEW.CHAR_HOURS_FLOWN,
AC_TTER = AC_TTER + NEW.CHAR_HOURS_FLOWN
WHERE AIRCRAFT.AC_NUMBER = NEW.AC_NUMBER;
END;
I get the following error:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAF' at line 1
Here is the original question:
Create a trigger named trg_char_hours that automatically updates the AIRCRAFT table when a new CHARTER row is added. Use the CHARTER table’s CHAR_HOURS_FLOWN to update the AIRCRAFT table’s AC_TTAF, AC_TTEL, and AC_TTER values.
(Hint: use temp values, as the INSERT event does not accept the OLD keyword.)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY