How do I convert BLOB into VARCHAR in MySQL?

旧城冷巷雨未停 提交于 2019-11-29 04:27:16
Luis Nuesi Tejada

try using this, I found it some time ago, you can convert it to char, not to Varchar2 or Varchar, haven't test it yet. Try:

CAST(a.ar_options AS CHAR(10000) CHARACTER SET utf8)

MySQL treat data unique. Hence there is a difference between Blob and Text. Text simply means a text string stored as original, not in binary, whereas a blob is a text string stored as a binary.

ilhan

try with the below query

alter table table_name change field_name field_name VARCHAR(1000);

I found this of MySQL's Website if you are trying to change your column to a different data type and keep the new data type in the database. Works great for what I need!

ALTER TABLE table_name CHANGE col col1 varchar(100)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!