使用ODBC方式读取sybase数据库的时候,如果字符串大于4k(4096),结果只能读取到4096个字符(关键字 SYBASE TEXT 4096 截断 TRUNCATE)
2013-10-17 14:25
453 查看
没搞过sybase ,这次搞sybase遇到这种很难在中午网上找到答案的问题,最终还是向英文网站求助
O(∩_∩)O哈哈~
总结解决方案:
Check these steps out - there is a new attribute to handle the Buffer column
size, not available in the
GUI configuration (I tried to get this in there!) and not sure why it can't be
there. The problem occurred at the
older 3.50 level when the driver started supporting Static cursors. Check these
items below and it should be OK ...
1. Check the TEXTSIZE for the ASE. On 12.5 it defaults to 32768 bytes. You
need this set to the anticipated
maximum text/image size.
2. The DSN itself has 2 options for this limitation. "DefaultLongDataBuffLen"
or Default Buffer Size for Long
Columns defaults to 1024 KBs (or 1 MB).
3. The StaticCursorLongColBuffLen was introduced to the 3.50 CtLib based driver
(12.0) for when the application
uses cursors. It is not accessible via the configuration screens and must be
added to the registry under the
DSN being used. This option defaults to 4096 Bytes (4K). You need to add this
in your connection string
(StaticCursorLongColBuffLen (SCLCBL - I think)) in BYTEs.(我就用的这个方案解决了问题)
These options have limitations because the driver pre-allocates these buffers
whenever the TEXT or IMAGE
datatype is to be used in your stmt.
On ASE whenever the text/image size is limited, silent truncation usually
occurs. This is behavior
on the ASE not the client.
I suggest you setup the 2 buffer length parameters in anticipation of the
maximim size of the BLOB type. The pre-allocation occurs
during the runtime, not when the driver itself is initialized.
实际操作:
在HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<ODBC 的dsn名称>注册表下,添加StaticCursorLongColBuffLen值为40960
当然这个值不一定要40960,只要大于4096就可以了哦
北大方正数字媒体部门陈炼
2013年10月17日14:24:17
O(∩_∩)O哈哈~
总结解决方案:
Check these steps out - there is a new attribute to handle the Buffer column
size, not available in the
GUI configuration (I tried to get this in there!) and not sure why it can't be
there. The problem occurred at the
older 3.50 level when the driver started supporting Static cursors. Check these
items below and it should be OK ...
1. Check the TEXTSIZE for the ASE. On 12.5 it defaults to 32768 bytes. You
need this set to the anticipated
maximum text/image size.
2. The DSN itself has 2 options for this limitation. "DefaultLongDataBuffLen"
or Default Buffer Size for Long
Columns defaults to 1024 KBs (or 1 MB).
3. The StaticCursorLongColBuffLen was introduced to the 3.50 CtLib based driver
(12.0) for when the application
uses cursors. It is not accessible via the configuration screens and must be
added to the registry under the
DSN being used. This option defaults to 4096 Bytes (4K). You need to add this
in your connection string
(StaticCursorLongColBuffLen (SCLCBL - I think)) in BYTEs.(我就用的这个方案解决了问题)
These options have limitations because the driver pre-allocates these buffers
whenever the TEXT or IMAGE
datatype is to be used in your stmt.
On ASE whenever the text/image size is limited, silent truncation usually
occurs. This is behavior
on the ASE not the client.
I suggest you setup the 2 buffer length parameters in anticipation of the
maximim size of the BLOB type. The pre-allocation occurs
during the runtime, not when the driver itself is initialized.
实际操作:
在HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<ODBC 的dsn名称>注册表下,添加StaticCursorLongColBuffLen值为40960
当然这个值不一定要40960,只要大于4096就可以了哦
北大方正数字媒体部门陈炼
2013年10月17日14:24:17
相关文章推荐
- 使用 Excel ODBC driver读取超过255的字符,数据可能被截断
- 从键盘输入一个由字母构成的字符串(不大于30个字符),要求从该串中取出3个不重复的字符,求所有不同的取法。如果字符串中没有取到3个不同的字符,则提示没有结果。对取出的字符要求按字母升序排列成串,对于不
- (本程序功能:字符串A中找出包含字符串B中所有字符的位置并输出) 在使用全局变量m的时候,输出错误的结果,而用下面局部变量M就没问题。
- 装饰者模式的学习(c#) EF SaveChanges() 报错(转载) C# 四舍五入 保留两位小数(转载) DataGridView样式生成器使用说明 MSSQL如何将查询结果拼接成字符串 快递查询 C# 通过smtp直接发送邮件 C# 带参访问接口,WebClient方式 C# 发送手机短信 文件 日志 写入 与读取
- 如何处理ODBC中EXCEL驱动读取EXCEL文件中字段长度大于255字符时出现的"数据截断"问题.
- PHP在处理ajax返回值的时候,如果使用return如 return $result会失败,echo $result却没问题。解释原因如下: 1.ajax请求从服务器端读取返回值,而且这些返回值必
- switch case 遍历 table表头的时候使用枚举来便利 (switch 不支持字符串类型,用这种方式来达到使用目的)
- 在使用NSArray打印的时候如果遇到中文字符那么会打印出来编码。
- MySQL查询中使用Concat关键字来拼接中文字符乱码(不同的数据类型拼接)解决方式
- C#对字符串含中文字符时按byte[]方式读取
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。
- //使用字符流的方式进行文件HelloWorld.java的读取并打印至控制台
- 数组字符串系列之:判断一个输入字符串中的每个字符唯一,只能使用基本的数据结构
- 题目: 输入一串数据,删除重复的数据。注意:读取字符串的顺序为从右往左,如果结果是以0结束,则删除0;如果结果有负号'-' 需要保留。
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。 提交
- OLEDB方式读取Excel丢失数据、字符串截断的原因和解决方法
- 处理EXCEL驱动读取EXCEL文件中字段长度大于255字符时出现的数据截断
- spring-data-jpa 中,如果使用了one-to-many , many-to-one的注释,会在Jackson进行json字符串化的时候出现错误