且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

INFORMATIONIX中Blob文本的子字符串操作

更新时间:2023-11-15 14:46:10

您可以使用子字符串运算符:

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

代码如下:

select txt, txt[3,5] from  _text_test

(txt是BLOB类型,但我也使用TEXT类型进行了测试).

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

警告!在我的测试中,当由JDBC(正确的值)和ODBC(似乎不正确)执行时,select会给出不同的第二字段值.我的ODBC客户端是3.70TC1和JDBC.3.70.JC1DE.请检查它是否在您的环境中正常工作.对于txt value = 1234567890,我使用ODBC获得了123,而使用JDBC获得了345.好像是虫子!

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!