Advertisement
juliarnasution

error trigger

Dec 18th, 2018
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.92 KB | None | 0 0
  1. mysql> SHOW TRIGGERS\G
  2. *************************** 1. row ***************************
  3.              Trigger: PlusOneCities
  4.                Event: INSERT
  5.                Table: Cities
  6.            Statement: UPDATE Countries SET NOfCities = NOfCities + 1 WHERE Code = NEW.CountryCode
  7.               Timing: AFTER
  8.              Created: NULL
  9.             sql_mode:
  10.              Definer: root@localhost
  11. character_set_client: utf8
  12. collation_connection: utf8_general_ci
  13.   Database Collation: latin1_swedish_ci
  14. 1 row in set (0.00 sec)
  15.  
  16. mysql> INSERT INTO Cities SET Name = 'City1', CountryCode = 'BRA', District = 'Brasilia', Population = 10000;
  17. Query OK, 1 row affected (0.04 sec)
  18.  
  19. mysql> RENAME TABLE Countries TO Country;
  20. Query OK, 0 rows affected (0.03 sec)
  21.  
  22. mysql> INSERT INTO Cities SET Name = 'City2', CountryCode = 'BRA', District = 'Brasilia', Population = 10000;
  23. ERROR 1146 (42S02): Table 'world.Countries' doesn't exist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement