How do I convert from BLOB to TEXT in Mysql?
2013-09-12 11:19
961 查看
After some googling for you i've found this. It's
an answer to a person who wants to convert blob to char(1000) with utf8 encoding
This is his answer. There is probably much more you can read about CAST right
here. Hope it helps some.
http://stackoverflow.com/questions/948174/how-do-i-convert-from-blob-to-text-in-mysql
an answer to a person who wants to convert blob to char(1000) with utf8 encoding
CAST(a.ar_options AS CHAR(10000) CHARACTER SET utf8)
This is his answer. There is probably much more you can read about CAST right
here. Hope it helps some.
up vote31down vote | Thats unnecessary, just use SELECT CONVERT(column USING utf8) FROM..... instead of just SELECT column FROM.....
| ||||||||||
|
up vote1down vote | or you can use this functionDELIMITER $$ CREATE FUNCTION BLOB2TXT (blobfield VARCHAR(255)) RETURNS longtext DETERMINISTIC NO SQL BEGIN RETURN CAST(blobfield AS CHAR(10000) CHARACTER SET utf8); END $$ DELIMITER ;
|
select * from test_table where Test_data = CAST( blobObject AS CHAR );
相关文章推荐
- How to convert from the color camera space to the depth camera space in Kinect For Windows
- how to convert varchar to float in mysql
- How to get the password text in a text with password property from another process using C++ - 用C++如何从不同进程获取密码框文本
- How to convert from int to string in objective c
- How do I generate a SQL script from my diagram in MySQL Workbench?
- FAQ How do I write to the console from a plug-in?
- Upload Data from Excel File in ABAP using TEXT_CONVERT_XLS_TO_SAP
- How do I convert an enum to a list in C#?
- How to convert from string to datetime in sql server? - Sealyu - BlogJava
- How to convert from int to string in objective c
- how to do graphics in java(quote from big java, 5e)?
- How do you copy the contents of an array to a std::vector in C++ without looping? (From stack over flow)
- How do I fix the linker error in project upgraded from VS2010 to VS2013 where the linker is looking
- In an iOS 5 Storyboard, how do you push a new scene to the original view controller from a Popover?
- In Java, how do I read/convert an InputStream to a String? - Stack Overflow
- How do I convert an enum to a list in C#?
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
- How Do I Convert an Integer to a String in Excel VBA
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code