Triggerni o’chirish
1 DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
46
Bu yerda:
schema_name — MB nomi trigger_name — Trigger nomi.
Yaratilgan triggerlar ro’yhati
1
2
3
SHOW TRIGGERS [{FROM | IN} db_name]
4
[LIKE 'pattern' | WHERE expr]
5
yo
SHOW TRIGGERS [FROM
ki
db_name] [LIKE 'pattern']
6
SHOW TRIGGERS
mysql> SHOW TRIGGERS\G;
*************************** 1. row ***************************
Trigger: test_user_pass
Event: INSERT
Table: user
Statement: BEGIN
SET NEW.name = LEFT(NEW.name,1);
SET NEW.otch = LEFT(NEW.otch,1);
SET NEW.pass = md5(NEW.pass);
END
Timing: BEFORE
Created: NULL
sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,
NO_ENGINE_SUBSTITUTION
Definer: root@localhost
character_set_client: utf8
collation_connection: utf8_general_ci
Database Collation: utf8_unicode_ci
1 row in set (0.01 sec)
Topshiriq: Har bir talaba INSERT, UPDATE, DELETE buyruqlariga
ikkitadan(Before va after) treggerlarni yaratishi va natijasi bilan ko’rsatib
o’tishi kerak.
Do'stlaringiz bilan baham: |