Advertisement
jakubs11

Untitled

May 17th, 2013
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.30 KB | None | 0 0
  1. delimiter //
  2. CREATE TRIGGER wyzwalacz AFTER INSERT ON customer FOR EACH ROW
  3. BEGIN
  4. INSERT INTO account VALUES(((SELECT MAX(account.AccNo) FROM account)+1),0,'Bugstone',CURDATE());
  5. INSERT INTO customer_account (RefNo, AccNo) VALUES(NEW.RefNo,(SELECT MAX(account.AccNo) FROM account));
  6. END//
  7. delimiter ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement