Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> SHOW TRIGGERS\G
- *************************** 1. row ***************************
- Trigger: PlusOneCities
- Event: INSERT
- Table: Cities
- Statement: UPDATE Countries SET NOfCities = NOfCities + 1 WHERE Code = NEW.CountryCode
- Timing: AFTER
- Created: NULL
- sql_mode:
- Definer: root@localhost
- character_set_client: utf8
- collation_connection: utf8_general_ci
- Database Collation: latin1_swedish_ci
- 1 row in set (0.00 sec)
- mysql> INSERT INTO Cities SET Name = 'City1', CountryCode = 'BRA', District = 'Brasilia', Population = 10000;
- Query OK, 1 row affected (0.04 sec)
- mysql> RENAME TABLE Countries TO Country;
- Query OK, 0 rows affected (0.03 sec)
- mysql> INSERT INTO Cities SET Name = 'City2', CountryCode = 'BRA', District = 'Brasilia', Population = 10000;
- ERROR 1146 (42S02): Table 'world.Countries' doesn't exist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement