`

Oracle Array_Example

阅读更多
-- Created on 2010/05/13 by NAN
declare
  -- Local variables here
  i integer;
  v_num PLS_INTEGER DEFAULT 0 ;
  TYPE t_table IS TABLE OF NUMBER;
  v_table t_table;
begin
  -- Test statements here
  v_table := t_table();
  FOR i IN 1 ..10 LOOP
      IF v_table.exists(i) = FALSE THEN
         v_table.extend;
         v_num := v_num + 1;
         v_table(v_num) := i;
      END IF ;
  END LOOP;
 
  FOR i IN v_table.first ..v_table.last + 10 LOOP
      IF v_table.exists(i) = FALSE THEN
         v_table.extend;
         v_num := v_num + 1;
         v_table(v_num) := i;
      END IF ;
  END LOOP;
 
  FOR i IN 1 ..v_table.count LOOP
      dbms_output.put_line(v_table(i));
  END LOOP;
 
  EXCEPTION
      WHEN OTHERS THEN
           dbms_output.put_line( SQLERRM);
end;

分享到:
评论

相关推荐

    oracle集合index-by表

    v_example_tab2 :=v_example_tab1; --集聚?值. dbms_output.put_line('An example array:'); dbms_output.new_line; dbms_output.put_line(to_char(v_example_tab2(1))||' '|| to_char(v_example_tab2(10))||' '|| ...

    最全的oracle常用命令大全.txt

    ORACLE常用命令 一、ORACLE的启动和关闭 1、在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a、启动ORACLE系统 oracle>svrmgrl SVRMGR>connect internal SVRMGR>startup ...

    Direct Oracle Access 4.1.2 Full Source for Delphi 2010

    w Query By Example mode for high performance queryable forms without any programming w Use PL/SQL blocks for server logic in your application w Increase batch performance with Array DML or Direct ...

    Expert Oracle Database Architecture 2nd Edition

    array of carefully constructed demonstrations that teach you how things work and how you should work and think. Consider just one example, indexing. There are many types of indexes, so we need a ...

    oracle truncate恢复

    4 4 4 D:\ORACLE\ORADATA\XJ\EXAMPLE01.DBF 4096 5 5 5 D:\ORACLE\ORADATA\XJ\INDX01.DBF 4096 6 6 6 D:\ORACLE\ORADATA\XJ\ODM01.DBF 4096 7 7 7 D:\ORACLE\ORADATA\XJ\TOOLS03.DBF 4096 7 8 8 D:\ORACLE\...

    MySQL and JSON A Practical Programming Guide 2018

    Written by a MySQL Community Manager for Oracle, MySQL and JSON: A Practical Programming Guide shows how to quickly get started using JSON with MySQL and clearly explains the latest tools and ...

    php.ini-development

    example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the specified encoding. ; Setting any output handler automatically turns on output ...

    PHP讲义 英文原著

    The core PHP language (version 5+) features powerful string- and array-handling facilities, as well as greatly improved support for object-oriented programming. With the use of standard and optional ...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    你可以利用PHP连接包括Oracle,MS-Access,Mysql在内的大部分数据库。你可以在苍蝇上画图,编写程序下载或者显示e-mail。你甚至可以完成网络相关的功能。最好的是,你可以选择你的PHP安装版本需要哪些功能。引用...

    jna-4.2.2 官方原版下载

    Java array and NIO Buffer arguments (primitive types and pointers) as pointer-to-buffer Nested structures and arrays Wide (wchar_t-based) strings Native long support (32- or 64-bit as appropriate)...

    Geotools Java API 开发gis的参考资料

    org.geotools.geometry.array org.geotools.geometry.coordinatesequence org.geotools.geometry.iso org.geotools.geometry.iso.aggregate org.geotools.geometry.iso.complex org.geotools.geometry.iso....

    VB编程资源大全(英文源码 数据库)

    Code example for saving and fetching the same in oracle and sql is also given.<END><br>8 , DBImpExp.zip A utility to import/export Access database from/to other application formats, e.g....

    javacv-platform-1.3.3-src

    Sun JDK http://www.oracle.com/technetwork/java/javase/downloads/ or IBM JDK http://www.ibm.com/developerworks/java/jdk/ Further, although not always required, some functionality of JavaCV also relies ...

    (重要)AIX command 使用总结.txt

    AIX常用命令://查看机器序列号,IBM的基本信息都可以通过该命令查询得到 #prtconf #oslevel -r == uname -a //操作系统版本 #oslevel //查看操作系统版本ex :5.1.0.0 #oslevel -r //ex:5100-04 == oslevel -q ...

    Delphi7.1 Update

    For example, for the French version of Delphi, rename SqlConst.dcu.fr to SqlConst.dcu. ========================================================KNOWN ISSUES* dbExpress driver - After installing this ...

    springmybatis

    MyBatis 目录(?)[-] mybatis实战教程mybatis in action之一开发环境搭建 mybatis实战教程mybatis in action之二以接口的方式编程 mybatis实战教程mybatis in action之三实现数据的增删改查 mybatis实战教程mybatis ...

    spring-framework-reference4.1.4

    Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................

    spring-framework-reference-4.1.2

    Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................

Global site tag (gtag.js) - Google Analytics