Stored Procedure not working in MySQL -


delimiter $$  drop procedure if exists `pawn`.`simpleproc`$$ create definer=`root`@`localhost` procedure  `pawn`.`simpleproc`(out param1 int, inout incr int) begin declare incr integer;     set incr= incr+1;     select count(*) param1 pawnamount;  end $$ 

this code create stored procedure....it's created.. execute..

call simpleproc(@param1,@incr); select @param1,@incr 

the result null values.. simple one.. i've tried many times.but,i null values only..

 declare incr int;                            -- incr null here, add default 0  if want have value set incr = incr + 1                          -- null + 1 still null select count(*) param1 pawnamount; -- if table pawnamount empty, generates empty set, in parameter assignment becomes null. 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -