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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -