Topic: 求助!关于mysql存储过程的问题 |
Print this page |
1.求助!关于mysql存储过程的问题 | Copy to clipboard |
Posted by: lylin1985 Posted on: 2009-04-14 14:49 我的存储过程里 IF( trim(VI_SEX) is not null AND LENGTH(VI_SEX) <> 0 )THEN SELECT COUNT INTO page_count FROM PLAYER t where t.GENDER =1 ; ELSE SELECT COUNT INTO page_count FROM PLAYER ; END IF; SET sequence = 'DESC'; SET @SQL_PAGE = 'SELECT ID,NICKNAME,PLAYERLEVEL,PKNUMBER,honorOne,HONORTWO,HONORTHREE,GOLDCONSUME FROM PLAYER '; IF(( trim(VI_SEX) is not null AND LENGTH(VI_SEX) <> 0) )THEN SET @SQL_PAGE =CONCAT( @SQL_PAGE , ' where GENDER = ' , VI_SEX); END IF; IF(( trim(ORDERS) is not null AND LENGTH(ORDERS) <> 0)AND (trim(sequence) is not null AND LENGTH(sequence) <> 0))then SET @SQL_PAGE = CONCAT(@SQL_PAGE , ' ORDER BY ' , ORDERS , ' ' , sequence); END IF; 执行到这里我用select @sql_page;还可以看到查询语句。 SET @SQL_PAGE = CONCAT( @SQL_PAGE , ' LIMIT ', (curPage-1) * vi_pagesige , ',' , vi_pagesige); 这句话后面就直接报@sql_page 为null了。l PREPARE STMT FROM @SQL_PAGE; EXECUTE STMT; 大家帮我看看,是什么原因,以前一直都那么写的。小弟百思不得其解。请各位高手赐教。谢谢。 |
2.Re:求助!关于mysql存储过程的问题 [Re: lylin1985] | Copy to clipboard |
Posted by: lylin1985 Posted on: 2009-04-14 14:57 已解决。是我不小心,把curPage没赋值。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |