日期:2014-05-17  浏览次数:21013 次

如何调用
create   or   replace   procedure   p_GetList_AnyTable_s  
(  
in_select   varchar2,   /*select   后面传入sql语句*/  
in_from   varchar2,   /*from   后面传入sql语句*/  
in_where   varchar2,   /*where   后面传入sql语句*/  
in_order_by   varchar2,   /*order   by   后面传入sql语句*/  
in_currentpage   number   /*当前页*/  
/*out_maxbtotalpage   out   number*/   /*可显示最大页书*/  
)  
is  
str   varchar2(1000);  
pagetotal   number:=10;   /*每页显示记录数*/  
mina   number;  
maxb   number;  
begin  
mina:=in_currentpage+(pagetotal*(in_currentpage-1));  
maxb:=in_currentpage*pagetotal;  
str:= 'select   '||in_select|| '   from   (select   '||in_select|| ',rownum   rn   from   '||in_from|| '   where   ';

if(in_where   is   not   null)then  
str:=str||in_where|| '   and   ';  
end   if;  
str:=str|| 'rownum <= '||maxb|| ')   where   rn> = '||mina;  
if(in_order_by   is   not   null)then  
str:=str|| '   order   by   '||in_order_by;  
end   if;  
execute   immediate   str;
end;
/

------解决方案--------------------
procedure p_GetList_AnyTable_s(aa,AAA,参数,参数,参数)