I am getting the following error while running a stored procedure in mysql5.0
Error Code : 1329
No data - zero rows fetched, selected, or processed.
I have an stored procedure SP1 which calls stored procedure SP2 and SP2 calls a function F1.
I have run this script from .bat file.
after executing i tried to call stored procedure 1 (update_stock), it gives error listed top.
But if i open stored procedure from sqlyog by clicking on alter procedure and rerun the stored procedure.
next time when i call the procedure it executes properly with out error.
Please help me with some solution.
The basic structre of procedure and function is given below
For eg.
----- stored procedure 1 -------------
Expand|Select|Wrap|Line Numbers
- DELIMITER $$;
- DROP PROCEDURE IF EXISTS `update_stock`$$
- CREATE PROCEDURE `update_stock`(upload_date varchar(10))
- BEGIN
- call update_closingstk(upload_date);
- END$$
- DELIMITER ;$$
----- stored procedure 2 -------------
Expand|Select|Wrap|Line Numbers
- DELIMITER $$;
- DROP PROCEDURE IF EXISTS `update_closingstk`$$
- CREATE PROCEDURE `update_closingstk`(upload_date varchar(10))
- BEGIN
- declare clsstock int default 0;
- set clsstock = get_closing_stk
- END$$
- DELIMITER ;$$
--- Function 1--------------
Expand|Select|Wrap|Line Numbers
- DELIMITER $$;
- DROP FUNCTION IF EXISTS `scm_db`.`get_closing_stk`$$
- CREATE FUNCTION `get_closing_stk`(upload_date varchar(10),productrid int ,pkt2cbb2 int) RETURNS int(11)
- BEGIN
- declare closingstock int;
- select clsstock into closingstock from clsstk_tab where stk_prod_rid=10;
- return IFNULL(closingstock ,0);
- END$$
- DELIMITER ;$$