Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2011
    Posts
    36

    Answered: BLOB to text / Cast bit data as text

    I have a third-part DB wherein the designers store raw RTF (Rich Text) in a BLOB field. I need to extract the raw RTF text from this. So I have tried CAST(MyField as VARCHAR(32000)), but the resultant field is also considered a BLOB field, so this did me no good. How can I extract the raw text of the BLOB field?

    So I guess this question may be better phrased as how to cast bit data as text.

  2. Best Answer
    Posted by mark.b

    "I don't think that there is a quick solution for this.
    I'd look at some java RTF API like RTFEditorKit and wrap it into some java UDF.
    See Java Code Examples for javax.swing.text.rtf.RTFEditorKit"


  3. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    I don't think that there is a quick solution for this.
    I'd look at some java RTF API like RTFEditorKit and wrap it into some java UDF.
    See Java Code Examples for javax.swing.text.rtf.RTFEditorKit
    Regards,
    Mark.

  4. #3
    Join Date
    Feb 2011
    Posts
    36
    Thank you. I get the distinct impression that this cannot be done in SQL because DB2 SQL does not have any native operators or functions to deal with this conversion. I can probably do it in VB, which is my development platform.

    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •