PL/SQL maximum size of VARRAY(PL/SQL VARRAY 的最大大小)
问题描述
我正在尝试找出 PL/SQL 中 VARRAY 可能的上限.
I'm trying to figure out the possible upper bound of VARRAY in PL/SQL.
我们肯定可以将 VARRAY 类型定义为
We sure can define VARRAY type as
TYPE type_name IS {VARRAY | VARYING ARRAY} (size_limit)
OF element_type [NOT NULL];
Oracle 文档是这样说的:
Oracle documentation has this to say:
每个 Varray 都存储为单个对象,或者在表中它是一列(如果 varray 小于 4KB)或在列之外表但仍在同一个表空间中(如果 varray 大于4KB).您必须在以下位置更新或检索 varray 的所有元素同时,这在执行某些操作时最合适一次完成所有元素.但是您可能会发现存储不切实际并以这种方式检索大量元素.
Each varray is stored as a single object, either inside the table of which it is a column (if the varray is less than 4KB) or outside the table but still in the same tablespace (if the varray is greater than 4KB). You must update or retrieve all elements of the varray at the same time, which is most appropriate when performing some operation on all the elements at once. But you might find it impractical to store and retrieve large numbers of elements this way.
但是size_limit
参数的上限是多少?是否等于无符号整数(4,294,967,295)?
But what is the upper bound of size_limit
parameter? Is it equal to unsigned integer (4,294,967,295)?
推荐答案
在 PL/SQL 中,限制为 2147483647.同样的限制适用于架构变化的数组类型.
Within PL/SQL the limit is 2147483647. The same limit applies to schema varying array types.
DECLARE
TYPE t IS VARRAY(2147483647) OF NUMBER;
BEGIN
NULL;
END;
如果你增加它,它会抛出 PLS-00325: non-integral numeric literal 2147483648 在这种情况下是不合适的
.
If you increase it it throws PLS-00325: non-integral numeric literal 2147483648 is inappropriate in this context
.
这篇关于PL/SQL VARRAY 的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PL/SQL VARRAY 的最大大小


基础教程推荐
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01