- 最后登录
- 2016-1-18
- 在线时间
- 80 小时
- 威望
- 44
- 金钱
- 645
- 注册时间
- 2011-12-27
- 阅读权限
- 10
- 帖子
- 89
- 精华
- 0
- 积分
- 44
- UID
- 125
|
2#
发表于 2012-12-26 15:26:27
- Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
- Connected as gyhzyl@192.168.253.5:1521/orcl
- SQL>
- SQL> create table test1 (t1 varchar2(200 bytes))
- 2 /
-
- create table test1 (t1 varchar2(200 bytes))
-
- ORA-00907: 缺失右括号
- SQL> create table test2 (t1 varchar2(200))
- 2 /
-
- Table created
-
- SQL> drop table test2 purge;
-
- Table dropped
-
- SQL> show parameter nls_length;
-
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- nls_length_semantics string BYTE
-
- SQL> alter session set nls_length_semantics=Char;
-
- Session altered
-
- SQL> create table test2(t1 varchar2(2));
-
- Table created
-
- SQL> insert into test2 values('北京');
-
- 1 row inserted
-
- SQL> insert into test values('bei');
-
- insert into test values('bei')
-
- ORA-00942: 表或视图不存在
-
- SQL> insert into test3 values('bei');
-
- insert into test3 values('bei')
-
- ORA-00942: 表或视图不存在
-
- SQL> insert into test2 values('bei');
-
- insert into test2 values('bei')
-
- ORA-12899: 列 "GYHZYL"."TEST2"."T1" 的值太大 (实际值: 3, 最大值: 2)
-
- SQL> insert into test2 values('北京另');
-
- insert into test2 values('北京另')
-
- ORA-12899: 列 "GYHZYL"."TEST2"."T1" 的值太大 (实际值: 3, 最大值: 2)
-
- SQL> commit;
-
- Commit complete
-
- SQL> alter session set nls_length_semantics=byte;
-
- Session altered
-
- SQL> create table test1 (t1 varchar2(4) );
-
- Table created
-
- SQL> insert into test1 values('北京');
-
- 1 row inserted
-
- SQL> select a.t1,b.t1 from test1 a,test2 b where a.t1 = b.t1;
-
- T1 T1
- ---- ----
- 北京 北京
-
复制代码 |
|