470,594 Members | 1,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Error Code : 1329, No data - zero rows fetched, selected, or processed. MYSQL

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 -------------

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 -------------

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--------------

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 ;$$
Jan 25 '08 #1
0 1798

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Sonnich | last post: by
2 posts views Thread by kkshansid | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.