MySQL Create Trigger if no exists? -
select trigger_schema, trigger_name information_schema.triggers; +------------------------+------------------+ | trigger_schema | trigger_name | +------------------------+------------------+ | tv_client1 | public_id | +------------------------+------------------+
i want added existing trigger public_id
tv_client2. how create trigger if not exists?
the final result should be:
select trigger_schema, trigger_name information_schema.triggers; +------------------------+------------------+ | trigger_schema | trigger_name | +------------------------+------------------+ | tv_client1 | public_id | +------------------------+------------------+ | tv_client2 | public_id | +------------------------+------------------+
the query select trigger_schema, trigger_name information_schema.triggers;
shows database name , trigger name. in case public_id
trigger has been created in tv_client1
database. if want same trigger exist in tv_client2
database can execute same create trigger public_id ...
code against tv_client2
database , same reflected in information_schema.triggers
.
Comments
Post a Comment