Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delimiter //
- CREATE TRIGGER trig_game_uniqueness_check BEFORE INSERT ON chess_games
- FOR EACH ROW
- BEGIN
- SELECT `id` INTO TMP_ID FROM `chess_games`
- WHERE `whiteUserID` = [HOW DO I ACCESS THIS?]
- AND `blackUserID` = [HOW DO I ACCESS THIS?]
- AND `outcome` = -1
- AND `tournamentID` IS NULL;
- IF TMP_ID IS NULL
- [HOW DO I ABORT INSERTION?]
- END IF;
- END
- delimiter ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement