易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 存储过程 交集

create or replace procedure TestJiaoJi
  is
   type nt_table_type is table of number;
   nt1 nt_table_type:=nt_table_type(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
   nt2 nt_table_type:=nt_table_type(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
   result nt_table_type;
       iTotalNum integer:=0;--记录交集个数,不包括0
  begin
    for n in 1..5
      loop
        nt1(n) :=n;
        nt2(n) :=n+2;       
      end loop;
    result:=nt1 multiset intersect nt2;--求交集
    dbms_output.put_line('交集是:');
    for i in 1..result.count
      loop
        if(result(i)!=0) then
          iTotalNum:=iTotalNum+1;
          dbms_output.put_line(''||result(i));
        end if;
      end loop;
    if result.count>0 then
      dbms_output.put_line('包括0在内的元素个数为:'||result.count);
    end if;
    if iTotalNum>0 then
      dbms_output.put_line('不包括0在内的元素个数为:'||iTotalNum);
    end if;
      --dbms_output.new_line;
  end TestJiaoJi;


相关文档:

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

Oracle中实现分页的方法

---------------------------------------------------------------------------
---- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
---- 转载务必注明原始出处
:
http://blog.csdn.net/andkylee
--- 2010-05-31 22:56:43
---- 关键字: oracle 分页 rownum
--------------------------------- ......

oracle与sqlserver插入数据动态字段值

记录一下以备下次快速找到。。。
       往tb_wf_privgrant表中插入一条记录,workflow_id字段值从tb_wf_workflow 表中获取workflow_name='知识审核'的所有记录中workflow_id最大值。
--oracle
declare   a NUMBER(10);
   begin
   select  max(wo ......

oracle命令操作

‘开始’-->‘运行’--> 输入‘cmd’ 打开cmd.exe -->输入‘cd c:\’ 切换到 c:\>
启动Oracle
c:\> svrmgrl
svrmgrl> connect   internal/oracle
svrmgrl> startup
svrmgrl> exit
启动监听器
c:\> lsnrctl   start ......

Oracle表空间的建立

CREATE TABLESPACE mySpace
datafile
'd:\data\data1.dbf' size 1M reuse
autoextend on next 100k maxsize 2M
'd:\data\data2.dbf' size 1M reuse
online
permanent;
其中online表联机。
联机和脱机的区别和使用
联机: ORACLE服务进程关联文件。可供oracle客户端访问.如果在系统中直接删除时会弹出异常。
脱机: ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号