hemmoo

laundry 28/10/2019

Oct 27th, 2019
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.30 KB | None | 0 0
  1. jualh-> tglbayar -> null (backup)
  2. bayar_before_insert trigger
  3.  
  4. #insert
  5. BEGIN
  6. update jualh set bayar = bayar + new.jumlah, tglbayar = CURRENT_TIMESTAMP() where idjualh = new.idjualh;
  7. END
  8.  
  9. #delete
  10. BEGIN
  11. update jualh set bayar = bayar - old.jumlah, tglbayar = null where idjualh = old.idjualh;
  12. END
Advertisement
Add Comment
Please, Sign In to add comment