改用动态的sql
str:='select topicid,title,boardid,locktopic,postusername,postuserid,dateandtime,
hits,votetotal,istop,lastposttime,isbest,isvote,lastpostusername,
lastpostuserid,bbscount,isdelete,bbsboard,topicimg,t_color
From
(
Select topicid,title,boardid,locktopic,postusername,postuserid,dateandtime,
hits,votetotal,istop,lastposttime,isbest,isvote,lastpostusername,
lastpostuserid,bbscount,isdelete,bbsboard,topicimg,t_color
From bbs_tb_bbsTopic t
--下面的lengthb(title) > MaxLength不正确
Where t.isbest = 1 and lengthb(t.title) >'|| MaxLength||'
order by t.dateandtime desc
) where rownum <= '||nPageSize;
open topicCursor for str;
str:='select topicid,title,boardid,locktopic,postusername,postuserid,dateandtime,
hits,votetotal,istop,lastposttime,isbest,isvote,lastpostusername,
lastpostuserid,bbscount,isdelete,bbsboard,topicimg,t_color
From
(
Select topicid,title,boardid,locktopic,postusername,postuserid,dateandtime,
hits,votetotal,istop,lastposttime,isbest,isvote,lastpostusername,
lastpostuserid,bbscount,isdelete,bbsboard,topicimg,t_color
From bbs_tb_bbsTopic t
--下面的lengthb(title) > MaxLength不正确
Where t.isbest = 1 and lengthb(t.title) >'|| MaxLength||'
order by t.dateandtime desc
) where rownum <= '||nPageSize;
open topicCursor for str;
--下面的lengthb(title) > MaxLength不正确
Where t.isbest = 1 and lengthb(title) > MaxLength
这里没有达到我要求的TITLE内容只有小于指定大小先择出来