Membuat TRIGGER pada database MySQL

Trigger?????? pasti pada lari kalo dengar triger,,, nech dah terbukti pada saat praktikum kemarin….mendengar namatriger seperti melihat hantu ternyata.. :).. ne sekilas tentang triger…

Trigger adalah suatu prosedur yang otomatis akan dijalankan apabila “pemicu” dari trigger itu dipanggil.

sebagai contoh: penghapusan satu tabel akan memicu suatu trigger untuk menghapus pada tabel yang lain yang telahditunjuk terlebih dahulu. dibawah ini saya berikan satu contoh penggunaan trigger pada database MySQL.

Sebagai contoh kita siapkan terlebih dahulu sebuah database dan tabel yang akan diuji coba seperti dibawah ini:

Kemudian buatlah sebuah trigger dengan kode seperti dibawah ini:

pada trigger di atas setiap kali perubahan dilakukan terhadap tabel COBA maka secara otomatis
tabel COBA2 akan dipengaruhi / terpengaruh.
Pembuatan trigger ini dapat digunakan untuk berbagai keperluan, selamat mencoba…..!


15 thoughts on “Membuat TRIGGER pada database MySQL

  1. Pasang plugin untuk penulisan kode sumber, supaya ga harus pasang gambar kekecila seperti itu. Lagian ngapain juga harus lari karna trigger, emangnya mukanya mirip pocong apa?

  2. Hello, I think your site might be having browser compatibility issues. When I look at your blog site in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, terrific blog!

  3. Hello! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no backup. Do you have any methods to stop hackers?

  4. Hey! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone4. I’m trying to find a theme or plugin that might be able to resolve this issue. If you have any suggestions, please share. With thanks!

  5. Thanks for your marvelous posting! I certainly enjoyed reading it, you happen to be a great author.I will make sure to bookmark your blog and definitely will come back in the future. I want to encourage that you continue your great writing, have a nice day!

  6. With almost everything which seems to be building throughout this particular subject matter, many of your viewpoints are quite stimulating. Even so, I am sorry, because I can not subscribe to your whole suggestion, all be it stimulating none the less. It looks to everybody that your opinions are actually not entirely validated and in simple fact you are generally your self not even thoroughly certain of your assertion. In any case I did enjoy examining it.

  7. Hi! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any tips?

  8. I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to construct my own blog and would like to know where u got this from. many thanks

  9. Love the blog, sincerely, Dr. Jones,

    Dental Health and Wellness Boston
    31 State Street, 7th Floor, Boston, MA 02109
    (617) 910-4780

  10. Is there anywhere else I can get information about this? I’m thinking I might write my term paper on it.

Leave a Reply

Your email address will not be published. Required fields are marked *