BLOB in CDATA XML - convert?

Hello

I'm on 11g

I have a BLOB that contains a gif file.

I would like to send this via in XML file to another site.

I thought it was, it was that I had to do, but I gueess not...
select xmlelement("Image", xmlcdata(UTL_ENCODE.BASE64_ENCODE(bl))) from xx;
Since I don't have a XML on how it is suppsed to look at, I see that the svobe is wrong. Here is the code used to generate the BLOB in the first place (from XML):
drop table xx;
create table xx (bl blob , blen number);

declare
 w_xml         XMLTYPE := 
 XMLTYPE('
<Image name="test" type="gif"><![CDATA[
R0lGODlhFAAUANUAAP/mIFVACP/iHEA0EP/aEPbOAPrWDOqqAPbKAPK2AOaZAG1Q
BPK+AP/iGKVtBP/eFPLCAO6yAPrSBFlACP/eGNquAP/mHLKJAKp9BMqNAJllAPrW
CM6FAPrOALp1APbOBM6ZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAACH+HUJ1aWx0IHdpdGggR0lGIE1vdmllIEdlYXIgNC4wACH5
BAkAACEALAAAAAAUABQAAAbFwJBwSCwajYGk8lgMLC4VBKSCWQSYoQDmYyAQDBIE
Q3M1TkCGh2AteBgKjMykeTFQBIB8XvBOYMpCCxJqAwN6hRQSDAcLQwF1AoYAhpID
BAgRDmUBFQR4eqAABAUJGZsInqGgD6QKmxAGn6qimK5CnBIUswB8EAccmxcIsaoC
owkHmkMLDAUGA58CFKOLCo2OGM0ShQ9fcBEKykQTGQkQCAUFUsgKHnNIGgcRCQkR
BwcKZFhODhkKChwcWMHiSEkSggiNBAEAOw
]]>
</Image>
');
w_clob clob;
w_blob blob;
w_blob_len number;
procedure save_to_file (p_blob blob, p_filename varchar2, p_dir varchar2 default 'METTE')
as
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER := 32767;
    l_pos INTEGER := 1;

    l_blob_len INTEGER;

BEGIN

    l_blob_len := DBMS_LOB.getlength(p_blob);
    l_pos:= 1;
    -- Open the destination file.
    l_file := UTL_FILE.fopen(p_dir,p_filename,'wb', 32767);

    -- Read chunks of the BLOB and write them to the file
    -- until complete.
    WHILE l_pos < l_blob_len LOOP
        DBMS_LOB.read(p_blob, l_amount, l_pos, l_buffer);
        UTL_FILE.put_raw(l_file, l_buffer, TRUE);
        l_pos := l_pos + l_amount;
    END LOOP;

    utl_file.fflush(l_file);
    -- Close the file.
    UTL_FILE.fclose(l_file);

    EXCEPTION
        WHEN OTHERS THEN
        -- Close the file if something goes wrong.
        IF UTL_FILE.is_open(l_file) THEN
            UTL_FILE.fclose(l_file);
        END IF;
        RAISE;

end save_to_file;

begin
  SELECT extractvalue(w_xml, '//Image') into w_clob from dual;
  w_blob := to_blob( UTL_ENCODE.BASE64_DECODE( UTL_RAW.CAST_TO_RAW(to_char(w_clob)) ) );

  w_blob_len := DBMS_LOB.GETLENGTH(w_blob);

  insert into xx values (w_blob, w_blob_len); 
  
  --- skriv filen til OS !
  save_to_file (w_blob,'mette.gif');
  commit;
  end;
/

select * from xx;
Can you help me?

Best regards
Mette

Hello

Given such binary RAW or BLOB data types are supported in the SQL/XML functions, but the content is implicitly converted to a string of hexadecimal characters.

This is the case here since BASE64_ENCODE returns a RAW.

The solution is to convert the RAW format, out VARCHAR2 explicitly:

SQL> set long 5000
SQL> set lines 300
SQL> select xmlelement("Image",
  2           xmlattributes('test' as "name", 'gif' as "type")
  3         , xmlcdata(
  4             UTL_RAW.CAST_TO_VARCHAR2(
  5               UTL_ENCODE.BASE64_ENCODE(bl)
  6             )
  7           )
  8         ) as result
  9  from xx;

RESULT
------------------------------------------------------------------------------------------------------------------------------------------------------


Note that you can hit limiting size for RAW SQL if you need to manage larger BLOBs.
You will then need to move to PL/SQL and finally to a coding function custom.

Tags: Database

Similar Questions

  • HOW TO SOLVE MY PROBLEM WITH MICROSOFT OPEN XML CONVERTER. WHEN AN E-MAIL CANO'T OPEN THE ATTACHMENTE

    Every time to enter an e-mail address, when have an attachmente I have intention to open but bring a dialog box telling me: 'Microsoft Open XML Converter.  Click here to open bring another dialog box telling me: "Save."  In the final, a small dialog box tell me: not recorded in any file. What should I do?

    Hi MarioVidal

     

    1. what email program are you using? What is windows live mail, Hotmail, Gmail, etc.?

    2. meet the issue only with some specific files types with come as attachments or with each of them?

    3. during how long have you had this problem?
    4. the problem occurs for all e-mail programs?


    Let us know the answers to help you best.

  • How can I convert blob to string xml?

    Hi all

    I need help to read an xml string longer than 4000 in the stored procedure.

    CREATE OR REPLACE PROCEDURE PROD. InsertFDataBlob(V_MYBLOB BLOB) AS

    BEGIN

    ........

    from SYS. XMLTYPE (V_MYBLOB)

    .......

    I couldn't find a simple way to convert my blob value that is V_MYBLOB to varchar. Are my versions of database 10g and 11g.


    Thank you.

    We don't need all this.

    The XMLType object already provides a builder working directly on a BLOB.
    Just pass the ID of the set of characters in addition to the binary content:

    For example, if the content is encoded in UTF - 8:

    ...
    passing xmltype(V_MYBLOB, nls_charset_id('AL32UTF8'))
    ...
    

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/t_xml.htm#i1009842

  • extract data from blob field containing xml data big

    I'm working on Oracle 11 g 2, 11.0.2.0.3. UNIX database server.

    my oracle instance receive large xml data service web ftp, I put this file as blob in a table called TBL_ALERT_XML (ID_ALERT NUMBER, DATE of the TIMESTAMP_ALERT, ALERT_XML BLOB).

    My goal is to get data of BLOB content e file put in one or more other tables.

    I try with the opening of a cursor on

    SELECT XMLTYPE (UTL_RAW.cast_to_varchar2 (ALERT_XML)). Extract (' alerts/points/point / / Text () ') threads

    OF TBL_ALERT_XML

    without any filter on ID_ALERT.

    But I get the error:

    ORA-22835: buffer too small for to CHAR CLOB or BLOB to RAW conversion



    Please help me, thank you very much

    Because the web service is deployed in python and my co worker is not able to call a stored procedure with the parameter xmltype, but only with the setting of the BLOB.

    If you can't get around it, so be it. All the less, using CLOB would be better.

    However, which prevents you to convert BLOB XMLType entry within the stored procedure and store it in an XMLType column.

    To do this, simply use the XMLType of BLOB.

    create table tbl_alert_xml)

    number of id_alert

    date of timestamp_alert

    alert_xml xmltype

    );

    insert into tbl_alert_xml

    values)

    1

    sysdate

    xmltype (p_blob

    , nls_charset_id ('AL32UTF8') - put the encoding of the file here

    )

    );

    Then, you will be able to execute queries optimized using XMLTABLE.

  • CDATA xml document links

    Hi all

    I am trying to add a html link within a parapgraph of the text which is loaded by an xml document. I did some research and it seems that I have to put my actionscript to read the html code. When I add the href attribute in the text it literally reads like the code instead of create a hyperlink in the paragraph. My problem is that I have not configured the original flash document and I have little course where add the htmlText = true; and so on.

    Here is the link. The problem is in the section "press." last line of the paragraph of text. You can see the aref code does not.

    http://atelierdelalain.com/index_test.html

    Thanks in advance for any help!

    Sandra

    XML data:

    <? XML version = "1.0" encoding = "utf-8" standalone = "yes"? >

    < images >

    < pic >

    < image > http://atelierdelalain.com/press/01.jpg < / image >

    < title > <! [CDATA [WHAT IS JAMES WEARING?]] > < / title >

    < desc > <! [CDATA [as you know by now, I like to integrate the work of the people of artisans and crafts fine inside I create for my clients and myself, a craft object individually can really make a space.]]

    This brings me to the cabinetmaker Emmanuel Delalain and its society Delalain workshop that make the most wonderful things in wood and metal. Elegant clean lines, highly regarded as feature and a rich sensual poetry in his work, he does not surprise us to learn Delalain has perfected his art as a young man in the workshop of coastal South of his French father and his grandfather, construction of sailboats.

    " To view the full article click here. < a href =" http://www.strutdenver.com [[ "target ="_blank"> < /a > of Strut]] > < / desc >

    < darkens > <! [CDATA []] > < / dark >

    < Comment > <! [CDATA []] > < / note >

    < miniature > http://atelierdelalain.com/press/thumbs/01.jpg < / thumbnail >

    < width > 600 < / width >

    < > 47 thumbwidth < / thumbwidth >

    < subpics >

    < / subpics >

    < / pic >

    < / images >

    ActionScript code:

    Mx.transitions import. *;

    Import mx.transitions.easing. *;

    displayWidth = Stage.width;

    function loadXML (loaded) {}

    If {(responsible)

    xmlNode = this.firstChild;

    image = [];

    title = [];

    DESC = [];

    If stump = [];

    Note = [];

    thumbnails = [];

    imageW = [];

    subimage = [];

    subthumb = [];

    subW = [];

    Subarray = new Array();

    Total = xmlNode.childNodes.length;

    for (i = 0; i < total; i ++) {}

    image [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [0].firstChild.nodeValue;

    title [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [1].firstChild.nodeValue;

    DESC [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [2].firstChild.nodeValue;

    DIMS [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [3].firstChild.nodeValue;

    Note [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [4].firstChild.nodeValue;

    thumbnails [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [5].firstChild.nodeValue;

    imageW [i] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [6].firstChild.nodeValue;

    If (i == 0) {}

    thisX = 0;

    w = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [7].firstChild.nodeValue;

    } else {}

    thisX = Number (w) + Number (2);

    thisW = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [7].firstChild.nodeValue;

    w = (thisX) Number + Number (thisW);

    }

    number of subpics

    total_subpics = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [8].childNodes.length;

    If (total_subpics! = undefined) {}

    Subarray [i] = new Array();

    for (x = 0; x < total_subpics; x ++) {}

    Subarray [i] [x] = new Array();

    Subarray [i] [x] [0] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [8] Sublst.ChildNodes(1).ChildNodes(0) [x] Sublst.ChildNodes(1).ChildNodes(0) [0].firstChild.nodeValue;

    Subarray [i] [x] [1] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [8] Sublst.ChildNodes(1).ChildNodes(0) [x] Sublst.ChildNodes(1).ChildNodes(0) [1].firstChild.nodeValue;

    subArray [i] [x] [2] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [8] Sublst.ChildNodes(1).ChildNodes(0) [x] Sublst.ChildNodes(1).ChildNodes(0) [2].firstChild.nodeValue;

    Subarray [i] [x] [3] = xmlNode.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [8] Sublst.ChildNodes(1).ChildNodes(0) [x] Sublst.ChildNodes(1).ChildNodes(0) [3].firstChild.nodeValue;

    }

    }

    thumbnails_fn (i, thisX);

    }

    firstImage();

    } else {}

    Content = "file not loaded! ';

    }

    }

    xmlData = new XML();

    xmlData.ignoreWhite = true;

    xmlData.onLoad = loadXML;

    xmlData.load("flash/press.xml");

    /////////////////////////////////////

    Listen = new Object();

    listen.onKeyDown = function() {}

    If (Key.getCode () == Key.LEFT) {}

    prevImage();

    } ElseIf (Key.getCode () == Key.RIGHT) {}

    nextImage();

    }

    };

    Key.addListener (listen);

    previous_btn.onRelease = function() {}

    prevImage();

    };

    next_btn.onRelease = function() {}

    nextImage();

    };

    /////////////////////////////////////

    p = 0;

    this.onEnterFrame = function() {}

    size of the file = picture.getBytesTotal ();

    load = picture.getBytesLoaded ();

    Preloader._visible = true;

    If (load! = filesize) {}

    Preloader.preload_bar._xscale = 100 * load/size of the file.

    } else {}

    Preloader._visible = false;

    If (picture._alpha < 100) {}

    Picture._alpha += 10;

    subHolder._alpha += 10;

    }

    }

    };

    function nextImage() {}

    If (p <(total-1)) {}

    p ++ ;

    If (load == filesize) {}

    void thumbs.

    subHolder.removeMovieClip ();

    If (subArray [p]! = undefined) {}

    createEmptyMovieClip ("subHolder", 10);

    subHolder._x = 800;

    for (z = 0; z < subarray [p] .length; z ++) {}

    subthumbs_fn (p, z);

    }

    createEmptyMovieClip ("line", 1);

    lineLen = z * 60 + z * 5;

    Line.lineStyle (1, 0x492F92, 100);

    Line.moveTo (795, 0);

    Line.lineTo (795, lineLen);

    createEmptyMovieClip ("line 2", 2);

    Line2.LineStyle (1, 0x492F92, 100);

    Line2.MoveTo (895, 0);

    Line2.lineTo (895, lineLen);

    } else {}

    Line._alpha = 0;

    Line2._alpha = 0;

    }

    subHolder._alpha = 0;

    EndSub thumbs.

    Picture._alpha = 0;

    picture.loadMovie (image [p], 1);

    displayWidth = Stage.width;

    imageWidth = imageW [p];

    RES = displayWidth-imageWidth.

    place = res/2;

    Picture._x = place;

    title_txt.htmlText = true;

    title_txt.htmlText = title [p];

    "desc_txt.htmlText = desc [p] + ' ' + fades [p] + '. "+ note [p];

    picture_num();

    }

    }

    }

    function prevImage() {}

    If (p > 0) {}

    p-- ;

    void thumbs.

    subHolder.removeMovieClip ();

    If (subArray [p]! = undefined) {}

    createEmptyMovieClip ("subHolder", 10);

    subHolder._x = 800;

    for (z = 0; z < subarray [p] .length; z ++) {}

    subthumbs_fn (p, z);

    }

    createEmptyMovieClip ("line", 1);

    lineLen = z * 60 + z * 5;

    Line.lineStyle (1, 0x492F92, 100);

    Line.moveTo (795, 0);

    Line.lineTo (795, lineLen);

    createEmptyMovieClip ("line 2", 2);

    Line2.LineStyle (1, 0x492F92, 100);

    Line2.MoveTo (895, 0);

    Line2.lineTo (895, lineLen);

    } else {}

    Line._alpha = 0;

    Line2._alpha = 0;

    }

    subHolder._alpha = 0;

    EndSub thumbs.

    Picture._alpha = 0;

    picture.loadMovie (image [p], 1);

    displayWidth = Stage.width;

    imageWidth = imageW [p];

    RES = displayWidth-imageWidth.

    place = res/2;

    trace("DW:"+DisplayWidth+"IW:"+ImageWidth+"x:"+place);

    Picture._x = place;

    title_txt.htmlText = true;

    title_txt.htmlText = title [p];

    "desc_txt.htmlText = desc [p] + ' ' + fades [p] + '. "+ note [p];

    picture_num();

    }

    }

    function firstImage() {}

    If (load == filesize) {}

    void thumbs.

    subHolder.removeMovieClip ();

    If (subArray [p]! = undefined) {}

    createEmptyMovieClip ("subHolder", 10);

    subHolder._x = 800;

    for (z = 0; z < subarray [p] .length; z ++) {}

    subthumbs_fn (p, z);

    }

    createEmptyMovieClip ("line", 1);

    lineLen = z * 60 + z * 5;

    Line.lineStyle (1, 0x492F92, 100);

    Line.moveTo (795, 0);

    Line.lineTo (795, lineLen);

    createEmptyMovieClip ("line 2", 2);

    Line2.LineStyle (1, 0x492F92, 100);

    Line2.MoveTo (895, 0);

    Line2.lineTo (895, lineLen);

    } else {}

    Line._alpha = 0;

    Line2._alpha = 0;

    }

    subHolder._alpha = 0;

    EndSub thumbs.

    Picture._alpha = 0;

    picture.loadMovie (image [0], 1);

    displayWidth = Stage.width;

    imageWidth = imageW [0];

    RES = displayWidth-imageWidth.

    place = res/2;

    Picture._x = place;

    title_txt.htmlText = true;

    title_txt.htmlText = title [p];

    "desc_txt.htmlText = desc [p] + ' ' + fades [p] + '. "+ note [p];

    picture_num();

    }

    }

    function picture_num() {}

    current_pos = p + 1;

    pos_txt. "Text = current_pos +" / "+ total;

    }

    function thumbNailScroller() {}

    the thumbnail code!

    this.createEmptyMovieClip ("tscroller", 1000);

    scroll_speed = 10;

    tscroller.onEnterFrame = function() {}

    If ((_root._ymouse > = thumbnail_mc._y) & & (_root._ymouse < = thumbnail_mc._y + thumbnail_mc._height)) {}

    If ((_root._xmouse > =(hit_right._x-60)) & & (thumbnail_mc.hitTest (hit_right))) {}

    thumbnail_mc._x = scroll_speed;

    } else if ((_root._xmouse < = (hit_left._x + 60)) & & (thumbnail_mc.hitTest (hit_left))) {}

    thumbnail_mc._x += scroll_speed;

    }

    } else {}

    delete tscroller.onEnterFrame;

    }

    };

    }

    function thumbnails_fn (k, xpos)}

    thumbnail_mc.createEmptyMovieClip ("t" + k, thumbnail_mc.getNextHighestDepth ());

    tlistener = new Object();

    tlistener.onLoadInit = {function (target_mc)}

    target_mc._x = xpos;

    target_mc.pictureValue = k;

    target_mc.onRelease = function() {}

    p = this.pictureValue - 1;

    nextImage();

    };

    target_mc.onRollOver = function() {}

    This ._alpha = 80;

    thumbNailScroller();

    };

    target_mc.onRollOut = function() {}

    This ._alpha = 100;

    };

    };

    image_mcl = new MovieClipLoader();

    image_mcl. AddListener (tlistener);

    image_mcl.loadClip (thumbnails [k], "thumbnail_mc.t" + k);

    }

    function scrollLeft() {}

    the thumbnail code!

    this.createEmptyMovieClip ("tscroller", 1000);

    If (thumbnail_mc.hitTest (hit_right)) {}

    thisX = thumbnail_mc._x;

    Dist = hit_right._x - thumbnail_mc._x;

    r = thumbnail_mc._width - dist;

    If (r > = 200) {}

    Agree = thumbnail_mc._x - 200;

    } else {}

    Agree = thumbnail_mc._x - r;

    }

    new Tween (thumbnail_mc, "_x", Regular.easeOut, thisX, agree,.5, true);

    }

    }

    function scrollRight() {}

    the thumbnail code!

    this.createEmptyMovieClip ("tscroller", 1000);

    If (thumbnail_mc.hitTest (hit_left)) {}

    thisX = thumbnail_mc._x;

    Dist = hit_left._x - thumbnail_mc._x;

    If (dist > = 200) {}

    Agree = thumbnail_mc._x + 200;

    } else {}

    Agree = thumbnail_mc._x + dist;

    }

    new Tween (thumbnail_mc, "_x", Regular.easeOut, thisX, agree,.5, true);

    }

    }

    buttonRight.onRelease = function() {}

    scrollLeft();

    };

    buttonLeft.onRelease = function() {}

    scrollRight();

    };

    function subthumbs_fn (d, z) {}

    subHolder.createEmptyMovieClip ("sub" + z, subHolder.getNextHighestDepth ());

    sublistener = new Object();

    sublistener.onLoadInit = {function (targ_mc)}

    targ_mc._x = 800;

    targ_mc._y = 60 * z + 5 * z;

    ////

    thumbWidth = subarray [p] [z] [3];

    thumbRes = 90-thumbWidth;

    thumbPlace = thumbRes/2;

    targ_mc._x = thumbPlace;

    trace (targ_mc._x);

    targ_mc.onRelease = function() {}

    p = this.pictureValue - 1;

    nextImage();

    Picture._alpha = 0;

    picture.loadMovie (subarray [p] [z] [0], 1);

    displayWidth = Stage.width;

    imageWidth = subarray [p] [z] [2];

    RES = displayWidth-imageWidth.

    place = res/2;

    Picture._x = place;

    This ._alpha = 30;

    picture_num();

    };

    targ_mc.onRollOver = function() {}

    targ_mc._alpha = 80;

    trace (targ_mc);

    };

    targ_mc.onRollOut = function() {}

    This ._alpha = 100;

    };

    };

    sub_mcl = new MovieClipLoader();

    sub_mcl. AddListener (sublistener);

    sub_mcl.loadClip (subarray [p] [z] [1], "subHolder.sub" + z);

    }

    Try this

    title_txt.html = true;
    title_txt.htmlText = title[p];
    
    desc_txt.html = true;
    desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
    
  • CDATA XML element inside mxml

    Hello

    I get confused about how the syntax to create a CDATA element in the script block in the mxml file. I do and I get a parse error:

    var tmpStr:XML = new XML ("<!") ("[CDATA [" + notes.text + "']] >");
    xmlFile.notes.tag = tmpStr;
    Results.Text = xmlFile.toXMLString ();

    I tried to use a backslash to escape to the "<" and ">" but which resulted in inconsistent behavior with the second line when I reread the xml file as on a mac, it reproduces the CDATA block and on the sides of linux and Windows he removed CDATA tags. Any help would be appreciated.

    Thank you
    Hoyt

    Breaking the closing of the CDATA node tag:
    var tmpStr:XML = new XML(" ");
    Tracy

  • Extract the value between the xml tags in the XML inside the BLOB field

    Hello

    I have a table that contains a BLOB column, this XML file to store column that received from an external source. Now for one of my needs. I need to read that value is the specific XML tag and create the entry in the database.

    Column name DataType
    IDNumber
    RecordBLOB OBJECT

    This is the XML code that is stored in the file inside the BLOB field format. XML below, I need go get AMC1234 there is after < itemName > text < / itemName > I thought to use XMLTYPE, but unfortunately my DBA team does not XML database, I now use UTL_RAW. CAST_TO_VARCHAR2 and recovery entire string, but I am not able to read actual result it takes. Can someone help me remove AMC1234.

    <? XML version = "1.0"? >

    <! DOCTYPE importFile SYSTEM "xyz.dtd" >

    -< importFile >

    -< importResult >

    < mode status = "DΘFINIR" > general failure < / status >

    < statusCode > 1 < / statusCode >

    invalid < errorMsg > list and holiday component < / errorMsg >

    -< returnInfo >

    < itemName > PRQ < / itemName >

    < Valeurelement > CBA < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > LMP < / itemName >

    < Valeurelement > CBA < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > KEY < / itemName >

    < Valeurelement > 9999 < / Valeurelement >

    < / returnInfo >

    -< returnInfo >

    < itemName > text < / itemName >

    < Valeurelement > AMC1234, FIXED_ALL, RED < / Valeurelement >

    < / returnInfo >

    < / importResult >

    < / importFile >


    Thank you

    Without

    Without - try something like...

    with t as (select"

    -

    -

    General failure

    1

    component and invalid vacation list

    -

    PRQ

    ABC

    -

    LMP

    ABC

    -

    KEY

    9999

    -

    Text

    AMC1234, FIXED_ALL, RED

    "the double pass."

    )

    Select Replace (regexp_substr (col,'([^<>']) itemName))

    , replace (regexp_substr (col,'([^<>""]) Valeurelement))

    t

    connection of level <=> ');

  • Oracle 9i excerpt/analyse XML in BLOB

    I have the table with the Blob column. In the column of the blog, I have data XML (see below).

    I tried to parse xml and get the note value '< GetTest >. How do I get there?

    Example table:

    create table SAMPLE_XML_TABLE
    (
      ID           NUMBER not null,
      XMLSTRING    BLOB,
    );
    

    <?xml version="1.0" standalone="no"?>
    <FromResponse xmlns="http://www.somewebsite.com/FromResponse">
      <Code>0000</Code>
      <Seller>
      <SellerServer>
      <Version>01</Version>
      <Sample>
      <GetTest>I wanted to get this Text</GetTest>
      </Sample>
      </SellerServer>
      </Seller>
    </FromResponse>
    

    And of course any fix untested untested code made things worse... * sigh *. DBMS_LOB.substr has an agenda of setting different than the regular substr.

    This solution has been tested (really!) and although it is not the most beautiful thing, it does the job

    Select dbms_lob.substr (xmlstring,

    DBMS_LOB. InStr(xmlString, '') - dbms_lob.instr (xmlstring, '') - length (''),

    DBMS_LOB. InStr (xmlstring, '') + length ('')) GetTest

    of sample_xml_table

  • XML in BLOB field.

    Hi Experts,

    ORACLE 10G

    My table structure as below the BLOB column with XML file

    Lobid number (10)
    File_Blob Blob () - with the XML from the file

    My requirement is to analyze the XML Blob of code put in dish/text file with separators now java code did this and take more time
    How to optimize it.

    Thank you very much
    Kalinga

    I'm not sure what you want to use 'any delimiter' and you have not specified your needs analyzing. The following will unload the blob to a file on the operating system.

    You can conver the blob xml as shown below and we many sql/plsql to work on the XML and then functions that write to a file.

    the write_blob_to_file methods are a copy of what I have in my custom util plsql package

    I hope this helps.

    Mark Wooldridge
    Secure Solutions, Inc. database.

    declare
    
    v     blob;
    x     xmltype;
    
    procedure write_blob_to_file(p_blob                    in blob,
                                 p_file                    in utl_file.file_type) is
    
    v_buffer     raw(32767);
    v_buffer_size     constant binary_integer := 8191;
    v_amount     binary_integer;
    v_offset     number;
    v_size          number;
    
    begin
     if p_blob is null or dbms_lob.getlength(p_blob) = 0
      then return;
     end if;
    
     v_size          := dbms_lob.getlength(p_blob);
     v_amount     := v_buffer_size;
     v_offset     := 1;
    
    -- dbms_output.put_line('length: '||v_size);
    
     while v_amount >= v_buffer_size and v_offset <= v_size
     loop
      dbms_lob.read(lob_loc     => p_blob,
                    amount     => v_amount,
                    offset     => v_offset,
                    buffer     => v_buffer);
    
      v_offset := v_offset + v_amount;
    
      utl_file.put_raw(file          => p_file,
                       buffer     => v_buffer,
                       autoflush     => true);
    
     end loop;
    
    end write_blob_to_file;
    
    procedure write_blob_to_file(p_blob                    in blob,
                                 p_directory               in varchar2,
                                 p_file_name               in varchar2,
                                 p_write_null_file               in boolean     default true) is
    
    c_line_size     constant number := 32767;
    v_file_handle     utl_file.file_type;
    
    begin
    -- dbms_output.put_line('blob_to_file -dir: '||p_directory||' - file: '||p_file_name||' - size: '||dbms_lob.getlength(p_blob));
    
     if not p_write_null_file and p_blob is null
      then return;
     end if;
    
     v_file_handle := utl_file.fopen(location     => p_directory,
                                     filename     => p_file_name,
                                     open_mode     => 'wb',
                                     max_linesize     => c_line_size);
    
     write_blob_to_file(p_blob, v_file_handle);
    
     utl_file.fclose(file => v_file_handle);
    
    end write_blob_to_file;
    
    begin
     /**
      * create example xml as a blob
      *
      * 873 is the character set id for NLS_CHARACTERSET  AL32UTF8
      * select *
      *   from v$nls_parameters
      *
      * select nls_charset_id('AL32UTF8')
      *   from dual
      *
      */
     select xmltype('fac1').getblobval(873)
       into v
       from dual;
    
     --* this was just a test to conver the blob to an xmltye
     x := xmltype(v, 873);
    
     write_blob_to_file(v, 'DEBUGDIR', 'msw.xml');
    
    end;
    /
    
  • Replace the configuration of the plugin apps config.xml element

    One of the plugins that I use has the following config: https://github.com/katzer/cordova-plugin-local-notifications/blob/master/plugin.xml

    One of the sections in there is:

    < target = "AndroidManifest.xml configuration file" parent = "/ manifest" > ""

    < android:name = "android.permission.RECEIVE_BOOT_COMPLETED permissions uses" / > "

    < android:name = "android.permission.WRITE_EXTERNAL_STORAGE permissions uses" / > "

    < / config-file >

    I would replace this is:

    < target = "AndroidManifest.xml configuration file" parent = "/ manifest" > ""

    < android:name = "android.permission.RECEIVE_BOOT_COMPLETED permissions uses" / > "

    < android:name = "android.permission.WRITE_EXTERNAL_STORAGE uses-permission" android: maxSdkVersion = "18" / > "

    < / config-file >

    This is because I understand that permissions are not forced to write to the external storage of your application from KitKat (4.4) (https://developer.android.com/guide/topics/data/data-storage.html#AccessingExtFiles), and I want to ask this permission is turned off for users to download the application.

    I build my app using PhoneGap Build (phonegap-version is cli - 6.3.0), is there any way of this from my apps config.xml file? So far I have tried several things led to errors on malformed or duplicate < uses credentials > elements config.

    Thank you

    Here are a few possibilities:

    1. The plugin of the fork and edit as you like and build from your fork (see the documentation for the use of rest git plugins: Plugins |) PhoneGap Docs).
    2. The plugin of the fork, edit and send a request to shoot for having him up-to-date on the repo of NPM (1 or 2).
    3. Try to use the element of the BMPS config file to change the manifest: change manifest. PhoneGap Docs (do not know if it will work in this use case).
  • How to print barcodes in Oracle XML Publisher report

    Hello

    We have a report of rdf that prints the bar code in the start page based on a custom procedure of MarkView. It works well with Oracle Reports.

    But given that this report was a matrix report, we change it a linear relationship by Oracle XML Publisher report.

    We have every possible thing in the new Oracle XML report... But we are not able to print data from barcode which is BLOB in the XML report...

    Can someone help me on this? We have dates UAT at the corner...

    We have a RTF model.

    Help as soon as possible.

    Thank you

    AFA

    Hello

    I even referring to this blog.

    How to create a report with a field of image (.jpeg). Maniacs Oracle & #039; Notes

    The bar code is original

    Thank you and best regards,

    AFA

  • split the file into 3 files xml txt

    I am creating 3 xml from 1 file txt in javascript files.

    I insofar as:

    A file containing text:

    GP0006896 # SunGold - 3 small # 00 NV ###Zespri Service Center # KLT0000110 # 16950 ###tray Kiwi SunGold pack of 3 small ###JWM # ZESPRI - 3 - D$ $$

    GP0012816 # S500-R012336 # 00 ###Poppies Nederland BV # KLT0000081 # 17890 ###Plus slagroomsoes 250 g #JWM # CULI - 10 - B$ $$

    GP0009000 ###test 01 # ###Just a test # KLT0001010 # 20596 ###Dit is een regel ###Standaard # TEST test - 01 - B$ $$

    The script:

    Set the variable

    var txtfolderpath = app.path+'/XML_converter/';

    var txtfilename = "txt_to_xml.txt";

    var txtfilelocation = File (txtfolderpath + txtfilename);

    var xmlfolderpath = app.path+'/XML_converter/xml/';

    var retChar = eval (' string.fromCharCode(0)) (13)');

    var presscancelbutton = 0;

    AppVersion var = app.version;

    var appversionarray = appversion.split('.');

    AppVersion = new Number(appversionarray[0]);

    xmlString = var ";

    Scriptfolderpathcheck

    #target illustrator

    var pathcheck = File($.fileName).parent.fsName;

    infopanelmenu();

    function infopanelmenu() {}

    Res =.

    "dialog box {------}.

    text: "TXT to XML format:', \"

    Properties: {resizable: false},

    margin: [0,0,0,0],

    ImageGroup: group {orientation: 'stack', preferredSize: 400 (221) and alignChildren: 'low'------}

    No.: group {orientation: 'column', margins: [0,0,0,20], \}

    infopanelgroup: Panel {orientation: 'column', preferredSize: 360 (20) and alignChildren: 'top', text: "TXT to XML conversion,"------}

    XmlGroup: group {orientation: 'row', alignment: 'left',------}

    s: StaticText {text: "XML converted: '"},

    S2: StaticText {text: '0'}, \

    } \

    statusgroup: group {orientation: 'row', alignment: 'left',------}

    s: StaticText {text: "Status:"},

    S2: StaticText {text: 'Ready to start'}, \

    } \

    } \

    infopanelbuttons: group {orientation: "rank", align: 'center', \}

    cancelBtn: button {text: 'Cancel', properties: {name: 'Cancel'}}, \

    applyBtn: button {text: 'Start', properties: {name: 'apply'}}, \

    } \

    } \

    } \

    }";

    WinInfo = new window (res);

    wininfo.frameLocation = [100, 100];

    Buttons

    wininfo.imagegroup.jobgroup.infopanelbuttons.cancelBtn.onClick = function () {}

    presscancelbutton = presscancelbutton - 1;

    WinInfo. Close();

    };

    wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.onClick = function () {}

    BuildXml();

    };

    WinInfo. Center();

    WinInfo. Show();

    }

    function buildxml() {}

    txtfilelocation. Open ('read');

    txtfile = txtfilelocation.read ();

    XmlArray var = txtfile.split('$$$');

    wininfo.ImageGroup.JobGroup.infopanelgroup.statusgroup.S2.Text = "Running";

    wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.text = "Running";

    wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.enabled = false;

    To read none

    for (i = 0; i < xmlarray.length - 1; i ++) {}

    var subxmlarray is xmlarray [i].split('###');.

    var counter = i + 1;

    xmlString = var ";

    xmlString = xmlstring + ' <? XML version = "1.0" encoding = "UTF-8"? > ' + retChar;

    xmlString = xmlstring + "< xml >" + retChar;

    xmlString = xmlstring + '< gp_number >' + subxmlarray [0] + "< / gp_number > ' + retChar;"

    xmlString = xmlstring + '< Steckerhalter >' + subxmlarray [1] + "< / number > ' + retChar;"

    xmlString = xmlstring + '< versienummer >' + subxmlarray [2] +' < / versienummer > ' + retChar;

    xmlString = xmlstring + '< klantnaam >' + subxmlarray [3] +' < / klantnaam > ' + retChar;

    xmlString = xmlstring + '< klantnummer >' + subxmlarray [4] +' < / klantnummer > ' + retChar;

    xmlString = xmlstring + '< ID >' + subxmlarray [5] + ' / ID <>' + retChar;

    xmlString = "< artikelomschrijving >" + xmlstring + subxmlarray [6] +' < / artikelomschrijving > ' + retChar;

    xmlString = "< workflow >" + xmlstring + subxmlarray [7] +' < / workflow > ' + retChar;

    xmlString = "< stans >" + xmlstring subxmlarray + [8] +' < / stans > ' + retChar;

    xmlString = xmlstring + ' < / xml > '

    wininfo.ImageGroup.JobGroup.infopanelgroup.XmlGroup.S2.Text = counter;

    Alert (xmlString); / / see if the stingbuild works <-works here 3 times

    Save the function

    var filename = subxmlarray [0] + ".xml";

    var xmlsavelocation = File (xmlfolderpath + filename);

    xmlsavelocation. Open ('w');

    xmlsavelocation.writeln (xmlString); / / Save the string <-works here 3 times, but generates two empty documents!

    xmlsavelocation. Close();

    }

    txtfilelocation. Close();

    wininfo.ImageGroup.JobGroup.infopanelgroup.statusgroup.S2.Text = "Ready"

    wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.text = "start";

    wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.enabled = true;

    }

    The output:

    output.png

    You will see that I get 3 files but 2 0 bytes.

    The question:

    Why can't I save the other two strings in an xml file?

    Thank you, Daniel

    Resolved:

    Divide the return in the text thus file to do the work function stop.

    Daniel

  • .csv file BLOB conversion

    Hi all


    I have two files (a .txt and a .csv). I have to send these two files through PL/SQL after their conversion to BLOB.

    How to convert .txt and .csv in BLOB files?

    Please help me in this regard.
    Thank you!


    --
    REDA

    889224 wrote:

    The requirement came as BLOB supports up to 4 GB if I'm not mistaken. So for this I have to convert it to BLOB.

    BLOB or CLOB are LOB data types. Oracle supports up to 128 PB type LOB data.

    Anyway is to be converted to BLOB?

    Convert what exactly? What is the source?

    If the source is an external file on the Oracle server, and then DBMS_LOB. LoadFromFile() can be used.

    If the source is an external file on the platform of the Oracle customer, then the customer must read the source file and use for example DBMS_LOB. WriteAppend() to add the source file for the LOB.

    If the client is a web browser, download of standard files can be used and the downloaded file will be in your table of documents mod_plsql .

    If the source is a web service, for example providing the file, UTL_HTTP can be used to read the output of the web service and the Chuck in a LOB.

    Etc.

    So it must be very clear on what exactly is the problem.

  • formatting as HTML XML

    I tried to teach/familularize me XML (signed for a class), I had a good help so far.

    Is it possible to format XML in HTML.

    I'll put up a web page, that will explain an actionscript, using the SPRY accordion. The code will be at the level of the label, and an explanation will be at the level of the content. the code and the explanation is stored in an XML file so that you can easily create new pages and make changes.

    [will probably use a framework for future projects]

    The problem I have is with line breaks

    example:

    I'll place the copy in the XML file in the tag

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    and get this

    import fl.transitions.Tween; import fl.transitions.easing. *; import fl.transitions.TweenEvent;

    How can I add line breaks or paragraph tags, so it can appear as

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    CDATA xml in html formats, so this:

    
    

    This will give you:

    import fl.transitions.Tween; import fl.transitions.easing.*; import fl.transitions.TweenEvent;
    

    because there is that no html line breaks in your xml. While this:

    
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent; ]]>

    This will give you:

    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    

    Next time try it yourself before asking for confirmation. If there is a problem and then come back, say you tried, post what you've tried has not worked. Do not waste our time for the confirmation of something that you can check yourself. If you find any information little conclusive when you search for a term and then try a different search result. After all, there are literally millions of articles to help you understand.

  • Client can not open my Word file

    I'm a writer to RESUME running OS X El Capitan 10.11.3.  I sent a resume in Word docx format to a customer who has an old Mac that works on 10.5.8.  She cannot open the file.  Then, I sent him back to him like a plain .doc file, but it can not open, either.  Is there a solution?  Or do I have to send the customer to the public library to use their computers?

    I am not technical and cannot think of anything else to do.  Thank you very much!

    ~ Monica

    Talk to your client:

    Using Word 2004 Mac users who receive a document from Word 2008 for Mac (or Word 2007 for Windows), will not be able to read it without going through the Open XML Converter installed, which can be downloaded from Microsoft.

    Go to this page:

    http://www.Microsoft.com/mac/downloads.mspx

    Click on right under the most popular «Open XML File Format Converter for Mac 1.0.2»

    This opens a window at the bottom of the page. Highlight on the bottom and click on English.dmg and it will download for you as a disk image, which can be installed in the usual way.

    After installation you can .xml opened and read in format Word 2008 documents in Word 2004.

    Update: This link http://support.microsoft.com/kb/976831 will take you to a new version 1.1.3 (released November 10, 2009).

Maybe you are looking for

  • Re: Satellite P300-150 - battery replacement not detected

    Hello I bought a replacement battery for my laptop that I got an error message saying that I should replace my battery. I bought a compatible battery, but it is not detected by my system. The battery indicator was strong when I plugged in for the fir

  • Yoga 3 Pro - how to take a screenshot? No button combination

    so, how to make a screenshot on the Yoga 3 pro? I can't find a button print Scren

  • Adware on my device

    There is a soft throwing ads in my notification bar and icons randomly appears on my homescreen leading to install app links. Also I get this droid dance logo and then add a full screen or add video appears. (Screenshot attached) Now I have not insta

  • Access denied when you delete a file from a batch file

    I run a batch file to compress and then delete the original file.The file is with everyone full access, and therefore the file.I run the batch Administrator file (literally, right click and choose Run as administrator).The delete operation has always

  • Bluetooth does not appear anywhere!

    I accidentally download a virus on my computer laptop inspiron 15 and get it restored bluetotth was working fine before hand, but now I'm not going to introduce myself. Is not in the control panel and my phone and I pod does not connect to it. How ma