Converting BLOB to different datatypes

  • Hi Experts,

    Is it possible to convert a java object which is now stored as a BLOB field to character values.

    The java object in BLOB contains parent and child values ,we need to differentiate those.The blob value contains

    some numbers, some charcters, some object itself this level of child objects may be more than 4-5 level

    Is it possible and if yes then how?

    Thanks in Advance.

  • Not unless you can deserialize the object using a SQLCLR object to review its properties, which I highly doubt. There is no native Java capability in SQL Server that would allow you to inspect that BLOB inside the database as if it were an object again, that I know of. You might be able to shoehorn the instantiation of a Java object into the scope of a SQLCLR object somehow by making an external call. Maybe you could have a SQLCLR object pass the BLOB to an external web service or executable for deserialization and inspection, but that would be terribly slow I would venture, if its even technically feasible. What you might want to start doing is storing the parent-child indicators in a separate column(s) next to the BLOB but you still have the problem of inspecting the existing data to initialize the new column(s).

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Thanks OPC

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply