Click here to get back home

blob to float conversion

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
blob to float conversion yoes 09-01-2006
Posted by yoes on September 1, 2006, 5:46 pm
Please log in for more thread options
Dear all,

I am very new in MySQL, I am working on image database project for my
research and I have problem how to convert blob field into float in
MySQL so that I can calculate the blob field with the MATH operation.

Does any one how to do it ????

Thank you very much indeed , for your help.

Regards
yoesufi


Posted by Aggro on September 2, 2006, 5:30 pm
Please log in for more thread options
yoes wrote:

> I am very new in MySQL, I am working on image database project for my
> research and I have problem how to convert blob field into float in
> MySQL so that I can calculate the blob field with the MATH operation.

If I understood you correctly, you have a field in your table and you
want to change the type of this field and at the same time calculate a
different value for it, but use the old value to do so. If so...

To minimize the risk of the data loss, to keep system down as little as
possible and to make it easy, I suggest that you first create a new
field first. Then put the correct value to that field and then remove
the blob and then rename the new field to the name what blob had.
Something like:

alter table yourtablename add newfield float;
update yourtablename set newfield = 1+1; # add correct formula here
# Now is a good place to check that the newfield
# actually has correct values
alter table yourtablename drop blobfield;
alter table yourtablename change newfield blobfield float;

If the database has users 24/7 and you are creating the float value from
always changing data, you should lock the table for that operation to
prevent anyone changing the values while working.

Those commands were written from memory, without checking if they
actually work. Please use with caution.

Similar ThreadsPosted
Varchar to Blob conversion July 13, 2005, 11:11 pm
NEED CONVERSION FOR "14:10:01.000 GMT Sat Oct 22 2005" October 24, 2005, 9:03 pm
OLE Automation Date conversion May 25, 2007, 9:26 am
blob size November 26, 2006, 10:18 pm
Using BLOB for storing data October 26, 2005, 3:36 am
BLOB Update failing on SQLParamData January 13, 2006, 6:41 am
Informix blob data migration to MySQL June 30, 2005, 5:04 am
product jpegs: best database field type: BLOB or filename? May 31, 2005, 9:32 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap