1

Possible Duplicate:
Mysql - How to quit/exit from stored procedure

Is there something equivelant to php's, c++, c, java, whatever return statement?

can i do something like

IF @numRows >= 1 THEN
  RETURN
END IF;

in mysql stored procedures???

Community
  • 1
  • 1
Not Amused
  • 942
  • 2
  • 10
  • 28

1 Answers1

1

Try this

Sp:BEGIN
    IF @numRows >= 1 THEN
        LEAVE Sp;
    END IF;

END$$
iJade
  • 23,144
  • 56
  • 154
  • 243