MySQL Forums
Forum List  »  Stored Procedures

Re: problems occurred when process multiple rows in procedure
Posted by: Duy Anh K. Dang
Date: September 21, 2011 04:34AM

Rick James Wrote:
-------------------------------------------------------
> See if swapping the order of these helps:
> DEALLOCATE PREPARE stmt;
> SELECT ROW_COUNT() INTO p_intResult;
>
> If not, report a bug at http://bugs.mysql.com


I tried

SELECT ROW_COUNT() INTO p_intResult;
DEALLOCATE PREPARE stmt;

and it worked well, thank you so much, Rick James!

But I wonder that if I write the procedure like this:

CREATE PROCEDURE p_delete_extensions (IN p_strExtIds TEXT, OUT p_intResult INT)
BEGIN
DELETE FROM tbl_file_extensions WHERE extension_id IN (p_strExtIds);
SELECT ROW_COUNT() INTO p_intResult;
END//

then I call it by pass parameters as below

CALL p_delete_extensions('1,2,3,4,5', @result);

it only deletes the first item (id = 1) and @result = 1

Anyone knows what the problem is here?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: problems occurred when process multiple rows in procedure
829
September 21, 2011 04:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.