Laboratoriya ishi Mavzu: sql triggerlar yaratish. Ishdan maqsad


Download 211.75 Kb.
Pdf ko'rish
bet3/3
Sana17.02.2023
Hajmi211.75 Kb.
#1207735
1   2   3
Bog'liq
Laboratoriya ishi Mavzu sql triggerlar yaratish. Ishdan maqsad

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

SHOW TRIGGERS [{FROM | IN} db_name]

[LIKE 'pattern' | WHERE expr]

yo
SHOW TRIGGERS [FROM
ki
db_name] [LIKE 'pattern']

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.  
  

Download 211.75 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling