• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Blob to float conversion

 
Greenhorn
Posts: 11
Google Web Toolkit Angular Framework Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 96
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79808
386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Google Web Toolkit Angular Framework Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Danger, 10,000 volts, very electic .... tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic