Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Blob to float conversion

 
Shainaz Tamboli
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I need to convert blob type to float format.
Could you please tell me how to do that?



Regards,
Shainaz
 
Wim Vanni
Ranch Hand
Posts: 96
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing that you mean java.sql.Blob

I find it strange that one would use a 'large object' type in the database to store a float. If this is the case however, you might want to use a stored procedure on the database to extract that float value and return it to you. That's what I would do anyway.

Cheers,
Wim
 
Campbell Ritchie
Sheriff
Posts: 51453
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you have already been told, you don't convert Blobs to floats. As already mentioned, there might be a float inside the Blob.

I think this discussion would sit better on our databases forum, so I shall move it.
 
Shainaz Tamboli
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi wim,
Yes I am talking about java.sql.Blob.
and I want to convert blob to float.

So Is this possible? If yes, then How?
Please help me to solve this.

Regards,
Shainaz
 
Wim Vanni
Ranch Hand
Posts: 96
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A 'Binary Large OBject' (BLOB) is typically used to hold documents or images when you wish to store them in a database. As been pointed out, it's very strange to have a float stored in such a database type. If for whatever reason this has been done, the question is not to convert blob to float, but to extract the value from the blob.
But I strongly suggest that you check your requirements.
Maybe you can give some more details about your project, some details about the database/table perhaps or even some code you've already written.

Cheers,
Wim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic