You are hereCan't create/alter table NVARCHAR2(4000)

Can't create/alter table NVARCHAR2(4000)


By surachart - Posted on 11 December 2008

Perhaps Someone ask why I can create/alter table with NVARCHAR2(4000)

If they read on Oracle Docs, they'll know NVARCHAR2 data type depend on National Character.

The maximum column size allowed is 4000 characters when the national character set is UTF8 and 2000 when it is AL16UTF16. The maximum length of an NVARCHAR2 column in bytes is 4000. Both the byte limit and the character limit must be met, so the maximum number of characters that is actually allowed in an NVARCHAR2 column is the number of characters that can be written in 4000 bytes.

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96529/ch6....

Example:
SELECT parameter, value FROM nls_database_parameters WHERE parameter LIKE 'NLS_NCHAR_CHAR%';

PARAMETER VALUE
----------------------------------------
NLS_NCHAR_CHARACTERSET AL16UTF16

create table A000 (col_test NVARCHAR2(4000));
create table A000 (col_test NVARCHAR2(4000))
*
ERROR at line 1:
ORA-00910: specified length too long for its datatype

create table A000 (col_test NVARCHAR2(2001));
create table A000 (col_test NVARCHAR2(2001))
*
ERROR at line 1:
ORA-00910: specified length too long for its datatype

create table A000 (col_test NVARCHAR2(2000));

Table created.



Syndicate

Syndicate content

Follow DatabasesLA on Twitter

Who's online

There are currently 0 users and 1 guest online.

Estadisticas

Locations of visitors to this page

hidden hit counter