MySQL Forums :: Newbie :: What is wrong with my Stored Procedure?


Advanced Search

What is wrong with my Stored Procedure?
Posted by: Scott Rich ()
Date: April 28, 2012 12:12AM

delimiter $$

DROP PROCEDURE IF EXISTS spChangeSystemTemplateFieldOrder$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `spChangeSystemTemplateFieldOrder`(IN idTemplateFieldSelected INT,
IN iOrderSelected INT, IN idTemplateFieldReplace INT, IN iOrderReplace INT, OUT sp_result TINYINT)

BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;

START TRANSACTION;

SET sp_result = 0;

/* Modify selected row order */
Update SystemTemplateFields
SET UDF_Order = iOrderSelected
WHERE idTemplateField = idTemplateFieldSelected;

/* Modify replaced row order */
Update SystemTemplateFields
SET UDF_Order = iOrderReplace
WHERE idTemplateField = idTemplateFieldReplace;

SET sp_result = 1;

COMMIT;


END$$

DELIMITER ;

When I call this procedure (CALL spChangeSystemTemplateFieldOrder(24,1,23,2,@a);) from the CLI, I get the following error:

ERROR 1436 (HY000): Thread stack overrun: 8992 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.

Any ideas?

Options: ReplyQuote


Subject Written By Posted
What is wrong with my Stored Procedure? Scott Rich 04/28/2012 12:12AM
Re: What is wrong with my Stored Procedure? Scott Rich 04/28/2012 12:47AM


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.