Advertisement
jakubs11

Untitled

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