All pastes #2076106 Raw Edit

Untitled

public sql v1 · immutable
#2076106 ·published 2011-06-07 10:45 UTC
rendered paste body
BEGIN    DECLARE rowcount INT DEFAULT 0;    DECLARE rowcount_temp INT DEFAULT 0;        DELETE FROM friend        WHERE character1_id = char_id        AND character2_id = friend_id;    SELECT row_count() INTO rowcount_temp;    IF (rowcount_temp > 0)        SET rowcount = rowcount + rowcount_temp;                <---------    DELETE FROM friend    WHERE character1_id = friend_id        AND character2_id = char_id;    SELECT row_count() INTO rowcount_temp;    IF (rowcount_temp > 0)        SET rowcount = rowcount + rowcount_temp;    SELECT rowcount;ENDSQL Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET rowcount = rowcount + rowcount_temp;