调用MySql 分页存储过程带有输入输出参数

 1 Create PROCEDURE getuser
 2 (
 3 IN pageIndex INT,
 4 IN pageSize INT,
 5 OUT count INT
 6 )
 7 
 8 BEGIN
 9 declare pindex int DEFAULT (pageIndex-1)*pageSize;
10 
11 select * from lc_user order by id  LImit pindex,pageSize;
12  
13 SELECT COUNT(id) INTO count from lc_user;
14 
15 END

调用:


1 CALL getuser(1,10,@count);

2 select @count; 

结果集:

 

posted @ 2014-07-28 19:40  b̶i̶n̶g̶.̶  阅读(358)  评论(0编辑  收藏  举报