I have > defined the column as 'blob' in the MySQL table. > I can read the text field of the source table into a variable e.g. The MySQL table has been set, except for this data. I'm trying to write an SQL statement that will generate an SQL script that will update a BLOB field with an IMAGE being selected from the database. This is what I have: select concat( 'UPDATE `IM.
I need to append data to my BLOB field,how can I do this using an UPDATE command?What i am asking is; is it possible to concatenate blob data so that i can eventually set it to a field likeUPDATE BLOB_tableSETBLOB_field = BLOB_field + BLOB_data
I tried using DBMS_LOB.APPEND but it does not return a value; so i created a function which gives me an error of 'invalid LOB locator specified'
botchedDevilbotchedDevil2 Answers
You need to create a temporary blob with DBMS_LOB.createtemporary
:
Then you should be able to use it in an update statement:
Vincent MalgratVincent MalgratWith help of PL/SQL blob can be updated in place with no need for custom function at all:
VadzimVadzimMysql Read Blob
Not the answer you're looking for? Browse other questions tagged oracleappendblob or ask your own question.
I've got a huge mysql table (called tcountriesnew
) and a column (called slogen, blob type
).In each of those slogen
blobs I'd like to replace a word, for example: banana
to apple
.
Unfortunately I tried to print all the rows with word banana, and it did not work.
select * from tcountriesnew where slogen like '%banana%';
Please help me.
- What i missed, what is the problem with my query?
- How can i replace text in blob?
3 Answers
Blob Column In Sql
Depends what you mean by 'replace' show in select:
Or update data in a table:
Update Blob Oracle Sql
BTW. Why are you using blob
for text? You should use text
type for textual data and blob
for binary data.
In some cases it is needed to save texts BLOB. In my case, for whatever reason Drupal 7 developers choose to use a blob for all TEXT columns - this is out of developer's control.
To convert a blob to text, use the MySql convert function. Then you have to save it into the database and convert it again to blob - but this is handled automatically by MySQL. So the following query would do the trick:
On MySQL 5.5, This resolved my issue completely.
Oracle Update Blob Column
Also, configure your PhpMyAdmin to show Blob data
DruvisionDruvisionMysql Blob Size
Which version are you using ? Maybe it's this bug : http://bugs.mysql.com/bug.php?id=27.Otherwise try to cast your blob column.
MatTheCat