sybaseoracle 发表于 2008-05-28 11:43

sybase varchar 字段长度的疑惑

按照网上的说法
自12.5开始,ASE支持2、4、8、16K的BLOCK,记录varchar长度也由1个字节变成了2个字节。换句话说现在varchar的长度可接近2/4/8/16K。

现在BOLOG是8K的 表TEST中有字段列名为TEST
列名        数据类型        允许为空        数据物理长度        数据有效位数        小数精度
test        varchar               8192              

insert into testvarchar
values(111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)
的时候为什么还是报错误 说长度不能超过255个字符呢??

chuxu 发表于 2008-05-28 12:02

select @@maxpagesize

sybaseoracle 发表于 2008-05-28 12:30

回复 #2 chuxu 的帖子

select @@maxpagesize

8192

呵呵 纳闷中。。

chuxu 发表于 2008-05-28 12:43

是isql中执行的吗?isql什么版本?

sybaseoracle 发表于 2008-05-28 14:02

回复 #3 sybaseoracle 的帖子

是用Embarcadero Rapid SQL 7.1.0执行的 呵呵

chuxu 发表于 2008-05-28 14:05

会不会是Rapid SQL 的限制?你直接用isql 试试?

sybaseoracle 发表于 2008-05-28 14:34

回复 #6 chuxu 的帖子

1> insert into testvarchar
2> values(111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)
3> go
Msg 103, Level 15, State 3:
Server 'jsplansk_syb', Line 2:
The number that starts with
'111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' is too long. Maximum length is 255.

Msg 168, Level 15, State 1:
Server 'jsplansk_syb', Line 2:
The number
'111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' is out of the range of machine representation (33 bytes).

1> select @@maxpagesize
2> go
            
-----------
      8192
还是不行哦

[ 本帖最后由 sybaseoracle 于 2008-5-28 14:48 编辑 ]

chuxu 发表于 2008-05-28 14:51

isql -v?
select@@version

sybaseoracle 发表于 2008-05-28 14:54

回复 #8 chuxu 的帖子

1> isql -v
2> go
Msg 102, Level 15, State 1:
Server 'jsplansk_syb', Line 1:
Incorrect syntax near 'v'.
1> isql -v
2> go
Msg 102, Level 15, State 1:
Server 'jsplansk_syb', Line 1:
Incorrect syntax near 'v'.
1> select@@version      
2> go
                                                                                                                                                                                                                                                               
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adaptive Server Enterprise/12.5.3/EBF 13329 ESD#7/P/HP9000-879/HP-UX 11.0/ase12
         53/1956/64-bit/FBO/Wed Mar 29 04:10:14 2006                                                                                                                                    

(1 row affected)
1>

sybaseoracle 发表于 2008-05-28 14:55

$ isql -v
Sybase CTISQL Utility/12.5.1/P-EBF11788 ESD #2/DRV.12.5.1.0/ibmaix64/AIX 5.1/BUILD1251-002/OPT/Tue Mar9 18:40:35 2004

Confidential property of Sybase, Inc.
Copyright 1987, 2003
Sybase, Inc.All rights reserved.
Unpublished rights reserved under U.S. copyright laws.

This software contains confidential and trade secret information of Sybase,
Inc.   Use,duplication or disclosure of the software and documentation by
theU.S.Governmentissubjecttorestrictions set forth in a license
agreementbetweentheGovernmentandSybase,Inc.orotherwritten
agreementspecifyingtheGovernment's rights to use the software and any
applicable FAR provisions, for example, FAR 52.227-19.
Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA

$
页: [1] 2
查看完整版本: sybase varchar 字段长度的疑惑