PL/SQL中集合出现“ORA-06533:下表超出数量”的问题解决
来源:互联网 发布:mac怎么截取gif动态图 编辑:程序博客网 时间:2024/06/01 08:52
DECLARE TYPE NUM_VARRAY IS VARRAY(100) OF NUMBER NOT NULL; V_NUM_VARRAY NUM_VARRAY:=NUM_VARRAY();BEGIN FOR J IN 1 .. 100 LOOP V_NUM_VARRAY(J) := J; END LOOP; FOR I IN 1 .. V_NUM_VARRAY.COUNT LOOP DBMS_OUTPUT.PUT_LINE(TO_CHAR(V_NUM_VARRAY(I))); END LOOP;END;
EXTEND Collection Method
EXTEND
is a procedure that adds elements to the end of a varray or nested table. The collection can be empty, but not null. (To make a collection empty or add elements to a null collection, use a constructor. For more information, see "Collection Constructors".)
The EXTEND
method has these forms:
EXTEND
appends one null element to the collection.EXTEND(
n
)
appends n null elements to the collection.EXTEND(
n
,i
)
appends n copies of the ith element to the collection.Note:
EXTEND(
n
,i
)
is the only form that you can use for a collection whose elements have theNOT
NULL
constraint.
EXTEND
operates on the internal size of a collection. That is, if DELETE
deletes an element but keeps a placeholder for it, then EXTEND
considers the element to exist.
Example 5-20 declares a nested table variable, initializing it with three elements; appends two copies of the first element; deletes the fifth (last) element; and then appends one null element. Because EXTEND
considers the deleted fifth element to exist, the appended null element is the sixth element. The procedureprint_nt
prints the nested table variable after initialization and after the EXTEND
and DELETE
operations. The type nt_type
and procedure print_nt
are defined inExample 5-6.
Example 5-20 EXTEND Method with Nested Table
DECLARE nt nt_type := nt_type(11, 22, 33);BEGIN print_nt(nt); nt.EXTEND(2,1); -- Append two copies of first element print_nt(nt); nt.DELETE(5); -- Delete fifth element print_nt(nt); nt.EXTEND; -- Append one null element print_nt(nt);END;/
Result:
nt.(1) = 11nt.(2) = 22nt.(3) = 33---nt.(1) = 11nt.(2) = 22nt.(3) = 33nt.(4) = 11nt.(5) = 11---nt.(1) = 11nt.(2) = 22nt.(3) = 33nt.(4) = 11---nt.(1) = 11nt.(2) = 22nt.(3) = 33nt.(4) = 11nt.(6) = NULL---
DECLARE TYPE NUM_VARRAY IS VARRAY(100) OF NUMBER NOT NULL; V_NUM_VARRAY NUM_VARRAY:=NUM_VARRAY();BEGIN FOR J IN 1 .. 100 LOOP V_NUM_VARRAY.EXTEND; V_NUM_VARRAY(J) := J; END LOOP; FOR I IN 1 .. V_NUM_VARRAY.COUNT LOOP DBMS_OUTPUT.PUT_LINE(TO_CHAR(V_NUM_VARRAY(I))); END LOOP;END;
- PL/SQL中集合出现“ORA-06533:下表超出数量”的问题解决
- SQL中集合操作
- ORA-00604 递归 SQL 级别 1 出现错误,ORA-01000 超出打开游标的最大数
- ORA-00604: 递归 SQL 级别 1 出现错误,ORA-01000: 超出打开游标的最大数
- ORA-00604 递归 SQL 级别 1 出现错误,ORA-01000 超出打开游标的最大数
- ORA-00604: 递归 SQL 级别 1 出现错误,ORA-01000: 超出打开游标的最大数
- ORA-00604 递归 SQL 级别 1 出现错误,ORA-01000 超出打开游标的...
- PL/SQL删除表出现ORA-00942错误
- ORA-02020的处理,dblink超出数量的设置
- Rman ORA-19921: 超出了 128 行的最大数量
- Java中集合的方法及子集(下)
- ORA-00604: 递归 SQL 级别 1 出现错误 ORA-01000: 超出打开游标的最大数 ORA-00604: 递归 SQL 级别 1 出现错误 ORA-01000: 超出打开游标的最大数
- oracle中集合的方法
- C#中集合的排序
- FreeMarker中集合的判断
- java中集合的知识点
- Spring中集合的注入
- Flex中集合的类型
- 当javaScript从入门到提高前需要注意的细节:对象部分
- 小城市程序员的迷茫和坚持
- Ryan's zone微信公众账号
- 里尔克和阿米亥(一)
- 《Linux命令行与Shell脚本编程大全》学习笔记1
- PL/SQL中集合出现“ORA-06533:下表超出数量”的问题解决
- 《Linux命令行与Shell脚本编程大全》学习笔记2
- pthread_cond_signal和pthread_cond_wait简介
- JAVA应用技术 ——IO(基本操作流)
- setup : esxi5.1.0 安装记录
- 基本数据类型的表现形式(字符)
- 学习各位前辈开个blog
- SHELL中的特殊变量和结构
- SSH框架,往Action注入bean