insert into varchar2(8000)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了insert into varchar2(8000),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1951字,纯文字阅读大概需要3分钟。
内容图文
在看12c的文档的时候发现varcahr2最大长度是4000 byte
VARCHAR2 Data Type
The VARCHAR2
data type specifies a variable-length
character string. When you create a VARCHAR2
column, you
supply the maximum number of bytes or characters of data that it can hold.
Oracle subsequently stores each value in the column exactly as you specify it,
provided the value does not exceed the maximum length of the column. If you try
to insert a value that exceeds the specified length, then Oracle returns an
error.
You must specify a maximum length for
a VARCHAR2
column. This maximum must be at least 1 byte,
although the actual string stored is permitted to be a zero-length string
(‘‘
). You can use the CHAR
qualifier, for
example VARCHAR2
(10
CHAR
), to
give the maximum length in characters instead of bytes. A character is
technically a code point of the database character set. You can use
the BYTE
qualifier, for
example VARCHAR2
(10 BYTE
), to explicitly
give the maximum length in bytes. If no explicit qualifier is included in a
column or attribute definition when a database object with this column or
attribute is created, then the length semantics are determined by the value of
the NLS_LENGTH_SEMANTICS
parameter of the session
creating the object. Independently of the maximum length in characters, the
length of VARCHAR2
data cannot exceed 4000 bytes. Oracle
compares VARCHAR2
values using nonpadded comparison
semantics.
To ensure proper data conversion between databases with different character
sets, you must ensure that VARCHAR2
data consists of
well-formed strings. SeeOracle Database Globalization Support Guide for
more information on character set support.
但是下面的SQL可以把8000长度的字符串insert到varchar2中。 为什么呢?
declare v1 varchar2(8000); begin v1 :=‘a‘; for i in1..7900 loop v1 := v1||‘a‘; end loop; --dbms_output.put_line(v1);insertinto t values(v1); end;
原文:http://www.cnblogs.com/kramer/p/3596867.html
内容总结
以上是互联网集市为您收集整理的insert into varchar2(8000)全部内容,希望文章能够帮你解决insert into varchar2(8000)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。