将BLOB转换为sql中的文本
问题描述:
我的数据库表中有一个字段,其数据类型为BLOB
.如何在SQL
中使用SELECT
查询以text/string
的形式查看内容.内容的MIMETYPE
是'text/xml charset=UTF8'
I have a field in my database table with data type as BLOB
.How can I view the content as text/string
using a SELECT
query in SQL
. the content's MIMETYPE
is 'text/xml charset=UTF8'
我尝试过这个,我不确定语法是否正确
I tried with this, I'm not sure if im right with the syntax
SELECT
CAST((SELECT column FROM myTable WHERE ID='56')AS CHAR(10000) CHARACTER SET utf8)
还有
SELECT
CONVERT(VARCHAR(max), CAST((SELECT column FROM myTable WHERE ID='56')
as binary)) from BIZDOCCONTENT
非常感谢
答
尝试:
SELECT CONVERT(object USING utf8)
FROM tablename