下载oracle账号密码是什么Oracle存储过程返回游标,查询语句通过动态SQL拼接的方式

1,首先创建自定义包,其中包含游标变量的声明

CREATE OR REPLACE package POLICE.pkg_package

as

    type type_cursor is ref cursor;

end;

2,存储过程的使用

CREATE OR REPLACE procedure POLICE.DangXmList(lx in varchar2,begin1 date,end1 date,num varchar2,type1 varchar2,name1 varchar2, cur_arg out pkg_package.type_cursor )

is

 mysql varchar2(1000);

begin

mysql:=select distinct * from v_p_dang_all where 1=1 ;

if lx<> then

  mysql:=mysql || and ALLKIND= || lx ||;

  end if;

if begin1<> then

  mysql:=mysql || and INSERT_TIME= || begin1 ||;

  end if;

if begin1<> then

  mysql:=mysql || and INSERT_TIME= || end1 || ;

end if;

if type1=xm then

oracle账号

    mysql:=mysql || and xm= || name1 || ;

    else

    mysql:=mysql || and id_code= || name1 || ;

    end if;

  open cur_arg for mysql ;

end;

 

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。