开发者

substring operation on blob text in informix

开发者 https://www.devze.com 2023-01-30 17:24 出处:网络
How can I substring a text of BLOB datatype in informix? If the operation is possible only on text of char d开发者_StackOverflow中文版atatype, is it possible to convert from BLOB to char (like to_char

How can I substring a text of BLOB datatype in informix? If the operation is possible only on text of char d开发者_StackOverflow中文版atatype, is it possible to convert from BLOB to char (like to_char in oracle)?

Thanks in advance,


You can use substring operator: http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.sqls.doc/sqls1069.htm

Code looks like:

select txt, txt[3,5] from  _text_test

(txt is of BLOB type, but I also tested using TEXT type).

WARNING! In my tests such select gives different 2nd field values when executed by JDBC (correct values) and ODBC (seems incorrect). My ODBC Client is 3.70TC1, and JDBC.3.70.JC1DE. Please check if it works correctly in your environment. For txt value=1234567890 I got 123 using ODBC and 345 using JDBC. Seems like bug!

0

精彩评论

暂无评论...
验证码 换一张
取 消