Hi,
I deliberately do mistake on line INSERT INTO table2....... but, it still commits despite variable of rowcount is set to 0. How can solve it?

Thanks

BEGIN
DECLARE rowcount INT;					
INSERT INTO table1 ………					
SELECT row_count() INTO rowcount;

IF (rowcount=1) THEN
    SET rowcount=0;
    INSERT INTO table2 ……………..
    SELECT row_count() INTO rowcount;

    IF (rowcount=1) THEN
        COMMIT;
    ELSE
       ROLLBACK;
    END IF;
END IF;
END

Hi,
I deliberately do mistake on line INSERT INTO table2....... but, it still commits despite variable of rowcount is set to 0. How can solve it?

Thanks

BEGIN
DECLARE rowcount INT;					
INSERT INTO table1 ………					
SELECT row_count() INTO rowcount;

IF (rowcount=1) THEN
    SET rowcount=0;
    INSERT INTO table2 ……………..
    SELECT row_count() INTO rowcount;

    IF (rowcount=1) THEN
        COMMIT;
    ELSE
       ROLLBACK;
    END IF;
END IF;
END

I believe it to be because you put SET rowcount=0;