??????????oracle?????????oracle???????????????????????????????????????????oracle????????洢??????ó??????ο???°ɡ?
??????????????漰????????α?exception???е???????????????????ο?????????鼮?ú???????~~
//oracle????洢????
create or replace proceduce fenye(tableName in varchar2??pageSize in number??pageNow in number??myRowCount out number??myPageCount out number??
p_cursor out t1.t---???????????α?
)
is
--???巋??
v_sql varchar2(500);
v_begin number:=(pageNow-1)*pageSize+1;
v_end number:=pageNow*pageSize;
begin
--?????в???
v_sql:='select * from ??select t1.*??rownum rn from(select * from '||tableName||') t1 where rownum<='||v_end||')where rn>='||v_begin||'':??????????????????????????
--???α??sql??????
open p_cursor for v_sql;
--????myRowCount??myPageCount
v_sql:='select count(*)from '||tableName||'';
execute immediate v_sql into myRowCount--???sql??????????????myRowCount
--????myPageCount
if mod(myRowCount??pageSize)=0 then
myPageCount:=myRowCount/pageSize;
else
myPageCount:=myRowCount/pageSize+1;
end if??
--????α?
close p_cursor;
end;