标签:
CREATE OR REPLACE PROCEDURE P_Pub_GetList ( StrWhere varchar2, ---查询条件(不带where关键字的查询条件) TableName varchar2, ---表名称 Field varchar2, ---字段名称 curArg out sys_refcursor --返回记录集 ) IS v_sql long := ‘‘; --sql语句 begin if StrWhere = ‘!@#$%^&*()全部‘ then--获取所有 v_sql := ‘select ‘|| Field ||‘ from ‘ || TableName; else --获取符合条件的 if StrWhere is not null then v_sql := ‘select ‘|| Field ||‘ from ‘ || TableName || ‘ where ‘ || StrWhere; else v_sql := ‘select ‘|| Field ||‘ from ‘ || TableName; end if; end if; --DBMS_OUTPUT.put_line(v_sql); OPEN curArg FOR v_sql; end P_Pub_GetList;
标签:
原文地址:http://www.cnblogs.com/rwh871212/p/4907086.html