Discussion:
Read BLOB from DB2 and convert to string
(too old to reply)
tharun reddy
2018-09-04 06:50:04 UTC
Permalink
How to convert blob to string
Franzw
2018-09-05 07:01:13 UTC
Permalink
I seem to remember doing this, but not how :-)

Anyhow - this pops up searching the WWW : https://stackoverflow.com/questions/29167074/unable-to-convert-blob-to-string

HTH
Regards
Franz Wolfhagen
j***@gmail.com
2018-09-06 05:27:23 UTC
Permalink
Post by tharun reddy
How to convert blob to string
Using TDI/SDI, a blob will be returned as a byte array.
If you want to convert this to a string using the platform encoding,
you could do the following, assuming the value is in conn.x:
var str = system.arrayToString(conn.getObject("x"))

If you want to specify an encoding, e.g. "UTF-8", you could do this:

var str = java.lang.String(conn.getObject("x"), "UTF-8")
tharun reddy
2018-09-06 12:33:39 UTC
Permalink
Post by j***@gmail.com
Post by tharun reddy
How to convert blob to string
Using TDI/SDI, a blob will be returned as a byte array.
If you want to convert this to a string using the platform encoding,
var str = system.arrayToString(conn.getObject("x"))
var str = java.lang.String(conn.getObject("x"), "UTF-8")
Thank for your reply jan


i have converted BLOB to Json.
now i need to parse that Json object to Excel.
can you please help me on this

Loading...