What is the max size of VARCHAR2 in PL/SQL and SQL?(PL/SQL 和 SQL 中 VARCHAR2 的最大大小是多少?)
问题描述
我使用的是 Oracle 10g.在要求中,我需要增加 pl/sql VARCHAR2 变量的大小.它已经是 4000 大小.我已阅读那
I am on Oracle 10g. In a requirement I need to increase the size of a pl/sql VARCHAR2 variable. It is already at 4000 size. I have read that
在 PL/SQL 中,VARCHAR2 可以达到 32767 字节.对于 SQL,限制是4000 字节
in PL/SQL, VARCHAR2 can be up to 32767 bytes. For SQL the limit is 4000 bytes
我可以增加这个变量的大小而不用担心 SQL 限制吗?
Can I increase the size of this variable without worrying about the SQL limit?
推荐答案
查看官方文档(http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330)
具有最大长度大小字节或字符的可变长度字符串.最大大小为 4000 个字节或字符,最小为 1 个字节或 1 个字符.您必须为 VARCHAR2 指定大小.BYTE 表示该列将具有字节长度语义;CHAR 表示该列将具有字符语义.
Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2. BYTE indicates that the column will have byte length semantics; CHAR indicates that the column will have character semantics.
但在 Oracle Databast 12c 中可能是 32767(http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF30020)
But in Oracle Databast 12c maybe 32767 (http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF30020)
具有最大长度大小字节或字符的可变长度字符串.您必须为 VARCHAR2 指定大小.最小大小为 1 个字节或 1 个字符.最大尺寸为:如果 MAX_STRING_SIZE = EXTENDED,则为 32767 字节或字符4000 字节或字符,如果 MAX_STRING_SIZE = STANDARD
Variable-length character string having maximum length size bytes or characters. You must specify size for VARCHAR2. Minimum size is 1 byte or 1 character. Maximum size is: 32767 bytes or characters if MAX_STRING_SIZE = EXTENDED 4000 bytes or characters if MAX_STRING_SIZE = STANDARD
这篇关于PL/SQL 和 SQL 中 VARCHAR2 的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PL/SQL 和 SQL 中 VARCHAR2 的最大大小是多少?
基础教程推荐
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
