Type arr is table of varchar2(5) index by binary integer;
解决方案 »
- oracle10g用域用户安装后database control无法启动,怎么解决?
- 大数据量的数据查询
- 关于ORACLE做HASH JOIN的问题
- 一条sql语句如何同时对两个服务器上的表进行操作??
- 一个让我很郁闷的问题
- 圣诞快乐 - 9i新函数
- 关于透明网关的问题,怎样设置SQL SERVER的连接?
- CREATE TABLE TEST2 (AAA CLOB); 需要什么权限?
- !!!*****寻Microsoft ODBC driver for Oracle联接Oracle9i方案(MSDTC)*****!!!
- 关于数据逻辑删除方式的讨论
- 一个问题.
- 关于oracle的management server登录?希望大家尽快帮我,比较急!
is table of varchar2(20) index by binary integer;
type nested_table is table of varchar2(2000);
type v_arrary is varray(1000) of varchar2(2000);
Example:In this example, we declare a table type of NUMBER and then assign two tables, results and n10. Notice how the indexes are used in each to specify a specific value.CREATE OR REPLACE FUNCTION max_value RETURN NUMBER IS
TYPE numtab IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;
results numtab;
n10 numtab;
max_loop NUMBER;
temp_store NUMBER;
CURSOR get_results IS
SELECT result FROM result_table;
i integer;
x integer:=1;
j integer:=1;
BEGIN
OPEN get_results;
FOR i IN 1..1500 LOOP
FETCH get_results INTO temp_store;
IF i = MOD(x,15) THEN
results(j):=temp_store;
END IF;
END LOOP;
j:=1;
FOR i IN 1..10 LOOP
n10(i):=GREATEST(results(j),results(j+1),results(j+2),
results(j+3),results(j+4),results(j+6),
results(j+7),results(j+7),results(j+8),
results(j+9));
j:=j+10;
END LOOP;
j:=1
max_loop:=GREATEST(n10(j),n10(j+1),n10(j+2),
n10(j+3),n10(j+4),n10(j+5),n10(j+6),n10(j+7),
n10(j+8),n10(j+9);
RETURN max_loop;
END;