PL/SQL和SQL中VARCHAR2的最大大小是多少? [英] What is the max size of VARCHAR2 in PL/SQL and SQL?
问题描述
我使用的是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?
推荐答案
请参阅官方文档(
可变长度的字符串,具有最大长度大小的字节或字符.最大大小为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个字节或字符
如果MAX_STRING_SIZE = STANDARD,则为4000个字节或字符 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的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!