Hello all,
I am new to procedures, so not really sure if what I'm doing is correct. I am trying to run a simple procedure, from the example page in mysql.com.
CREATE PROCEDURE doiterate(p1 INT)
BEGIN
label1: LOOP
SET p1 = p1 + 1;
IF p1 < 10 THEN
ITERATE label1;
END IF;
LEAVE label1;
END LOOP label1;
SET @x = p1;
END;
I get a syntax error at the p1 + 1; line. Even if I was to take all the other stuff out of the procedure I still get a syntax error.
I don't know what is going on? am I not supposed to run procedures in Mysql workbench? if so, where am I suppose to run them?
Thanks for any help, before hand..
I am new to procedures, so not really sure if what I'm doing is correct. I am trying to run a simple procedure, from the example page in mysql.com.
CREATE PROCEDURE doiterate(p1 INT)
BEGIN
label1: LOOP
SET p1 = p1 + 1;
IF p1 < 10 THEN
ITERATE label1;
END IF;
LEAVE label1;
END LOOP label1;
SET @x = p1;
END;
I get a syntax error at the p1 + 1; line. Even if I was to take all the other stuff out of the procedure I still get a syntax error.
I don't know what is going on? am I not supposed to run procedures in Mysql workbench? if so, where am I suppose to run them?
Thanks for any help, before hand..