分页存储过程执行时报错,请大家帮忙看看。
create or replace procedure fenye(tablename varchar2,
pagesize number,--3 5
pagenow number,--2 2
mycount out number,
mypagecount out numdber,
p_cursor out textpackage.text_cursor) is
v_begin number:=(pagenow-1)*pagesize+1;--1 6
v_end number:=pagenow*pagenow;--3 10
v_sql varchar2(200)
begin
v_sql:='select * from (select t.*,rownum rn from (select * from '||tablename||') t where rownum<='||v_end||')
where rn>='||v_begin;
open p_cursor for v_sql;
v_sql:='select count(*) from '||tablename;
execute immediate v_sql into mycount;
if mod(mycount,pagesize)=0 then
mypagecount:=mycount/pagesize;
else
mypagecount:=mycount/pagesize+1;
end if
close p_cursor;
end fenye;
------解决方案--------------------我第一眼就看到了你的enf if后面没有分号;