MySQL Forums
Forum List  »  Triggers

Re: Mysql Trigger Error
Posted by: Stopka Miroslav
Date: March 23, 2011 09:16AM

I solved it already :D but thx. Im beginner :) First mistake was delimiter.

delimiter $$
create trigger hinewplayertableTrig before insert on hinewplayertable
for each row
begin
declare tableT int;
declare seatS int;
select idTable, idSeat into tableT, seatS from hinewplayertable
where idPlace = (select max( idPlace )from hinewplayertable ) ;
if(seatS = 10) then
set new.idSeat = 1;
set new.idTable = tableT + 1;
else
set new.idSeat = seatS + 1;
set new.idTable = tableT;
end if;
set new.chips = 1500;
set new.rank = 0;
end$$
delimiter;

Options: ReplyQuote


Subject
Views
Written By
Posted
3329
March 23, 2011 08:21AM
1246
March 23, 2011 08:35AM
1394
March 23, 2011 09:12AM
Re: Mysql Trigger Error
1390
March 23, 2011 09:16AM
1079
March 23, 2011 09:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.