使用ODBC方式读取sybase数据库的时候,如果字符串大于4k(4096),结果只能读取到4096个字符(关键字 SYBASE TEXT 4096 截断 TRUNCATE)
来源:互联网 发布:数控加工编程代码讲解 编辑:程序博客网 时间:2024/06/01 11:36
没搞过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
- 使用ODBC方式读取sybase数据库的时候,如果字符串大于4k(4096),结果只能读取到4096个字符(关键字 SYBASE TEXT 4096 截断 TRUNCATE)
- 使用 Excel ODBC driver读取超过255的字符,数据可能被截断
- C#使用ODBC连接SYBASE数据库的方法
- C#使用ODBC连接SYBASE数据库的方法
- Sybase数据库的使用
- Sybase 的ODBC配置
- 使用sybase 时候遇到的问题
- 使用命令方式操作sybase数据库
- 使用命令方式操作sybase数据库
- 给定一个字符串和一个整数k,对字符串开头算起的每2k个字符的前k个字符进行反转。 如果还有少于k个字符,则将其全部撤消。 如果小于2k但大于或等于k个字符,则反转前k个字符,
- 远程链接sybase数据库的链接字符串
- Sybase的安装、配置及使用(五) Sybase数据库的常用工具说明
- Sybase数据库使用点滴
- Sybase数据库使用总结
- sybase数据库使用总结
- PHP中查询SQL Server或Sybase时TEXT字段被截断的解决方案
- PHP中查询SQL Server或Sybase时TEXT字段被截断的解决方案
- 解决Oracle的Char只能读取第一个字符
- [WCF]由于签名问题,运行某些基于 WCF 的项目模板将导致与 svcutil.exe 崩溃
- Linux 开机自启动
- 做好准备,让你的短信应用迎接Android 4.4(KitKat)
- DataGrid数据直接导出Excel在IE中打开。 (收集,还没有测试下)
- MVC Html.DropDownList 和DropDownListFor 的常用方法
- 使用ODBC方式读取sybase数据库的时候,如果字符串大于4k(4096),结果只能读取到4096个字符(关键字 SYBASE TEXT 4096 截断 TRUNCATE)
- 交叉编译基础 host,build,target
- 运行时的库搜索路径
- erlang杂记十一--不要偷懒的事情
- Android Studio使用教程(一)
- CentOS下命令行和桌面模式的切换方法
- va_list、va_start、va_arg、va_end宏的使用
- python 几个机器学习的库的算法比较。发现自已只懂其中几个。
- Delphi XE5 Android 运行黑屏卡死的解决方法