1
1楼 sxlcom 2007-04-29 11:29:46 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; / 2楼 sxlcom 2007-04-29 11:42:13 如果我有表AAA(aa number,bb varchar2(500)) 如何调用存储过程来显示AAA中的数据 3楼 njuzgj 2007-04-29 11:53:33 procedure p_GetList_AnyTable_s(aa,AAA,参数,参数,参数) 4楼 sxlcom 2007-04-29 12:18:36 我用以下语句不行呀! begin exec p_GetList_AnyTable_s(aa,AAA,where aa=1,aa,1); end; 提示: ERROR 位于第 2 行: ORA-06550: 第 2 行, 第 7 列: PLS-00103: 出现符号 "P_GETLIST_ANYTABLE_S "在需要下列之一时: := . ( @ % ; 符号 ":= " 被替换为 "P_GETLIST_ANYTABLE_S " 后继续。 ORA-06550: 第 2 行, 第 35 列: PLS-00103: 出现符号 "WHERE "在需要下列之一时: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute 5楼 sxlcom 2007-04-29 12:46:09 我用以下语句出不行为什么??
begin str varchar2(1000); str:= 'select * from AAA '; execute immediate str; end
搜索墙@2009 www.pkwall.com all rights reserved QQ:276471788 [京ICP备09111534号]
声明:本站部分数据来源于网络,仅供参考,如有版权问题,请联系我们,我们将及时删除!转载本站请注明来源
| |||||