Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    41

    Unanswered: extract image from blob

    Hello,

    I am trying to extract an image from xml in a clob column.

    I want to export the image into an ixf file and then import the image into another blob column of another database.

    At the moment - my extract command does not take the full length of the string within the tag as it is too long...

    How can I fix this ?

    I tried to cast as a blob but it would not allow me.

    Code:
    SELECT
    		row_number() over (order by ImageBase64) as MESSAGEID,
    		ImageBase64
    		FROM (
    		select DISTINCT cast(CASE
    		WHEN (POSSTR(COMMENTTEXT,'<RmsCurrentMessage-Image>')=0) THEN 'NA' 
    		WHEN 
    		(POSSTR(COMMENTTEXT,'<RmsCurrentMessage-Image>')>0)
    		THEN
    		substr(COMMENTTEXT,(POSSTR(COMMENTTEXT,'<RmsCurrentMessage-Image>')+25),(POSSTR(COMMENTTEXT,'</RmsCurrentMessage-Image>')-25)-POSSTR(COMMENTTEXT,'<RmsCurrentMessage-Image>')) END as varchar(64000)) AS ImageBase64
    		FROM MESSAGE);

    Thanks in advance

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    db2level-platform
    publish the used command
    maybe related to modified by lobsinfile (just a guess)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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