Question

My trigger looks like this:

begin
IF ((NEW.tgebucht >= NEW.tteilnmax) AND (NEW.tgebucht!=0) AND (OLD.tstatus=0)) THEN
  SET NEW.tstatus = 1;
ELSEIF ((NEW.tgebucht < NEW.tteilnmax) AND (OLD.tstatus=1)) THEN
  SET NEW.tstatus =0;
END IF;
IF ((0,25*NEW.tteilnmax)>=(NEW.tteilnmax-NEW.tgebucht)) THEN
    SET NEW.trestplatze =1;
END IF;
end

And I am getting an error like this:

Operand should contain 2 column(s)

I am not really sure why, I know it is related to second if but I can't configure where, does anyone has an idea what to change? Am I doing something wrong here? Any help would be appreciated.

Was it helpful?

Solution

The syntax looks well. But there is a hidden bug in next line -

IF ((0,25*NEW.tteilnmax)>=(NEW.tteilnmax-NEW.tgebucht)) THEN

You should use '.' as a point delimiter -

IF ((0.25*NEW.tteilnmax)>=(NEW.tteilnmax-NEW.tgebucht)) THEN
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top