Search code examples
xmloracle-databaseibm-integration-busextended-sql

IIB/Esql how to propagate XMLTYPE from oracle table to OutputRoot.XMLNSC


I have a message flow with a compute node and an MQOutput node that looks like this:

MQInput->Compute->MQOutput

In the compute node I retrieve an array of xml documents from an oracle database like this:

declare xmlDoc row;
set xmlDoc.rows[] = passthru('select XMLTYPE.getClobVal(xml_document) as xml from my_table where something=something');

I verified that this is working correctly, then I try to put the XML to the MQOutput node like this:

    FOR xml AS xmlDoc.rows[] DO
        CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC')
                                    PARSE(CAST(xml.XML AS BLOB CCSID InputProperties.CodedCharSetId ENCODING InputProperties.Encoding), 
                                    InputProperties.Encoding,
                                    InputProperties.CodedCharSetId);    

        PROPAGATE;
    END FOR;
    RETURN FALSE;

There's no errors when the flow runs, but nothing is put on the output queue. I'm looking for some guidance as to the correct way to take the XMLTYPE from the oracle database and put it to the MQOutput node.

Thanks


Solution

  • I got it to work my changing the SQL query to use getBlobVal.

    New SQL query:

    set xmlDoc.rows[] = passthru('select mt.xml_document.getBlobVal('UTF8') as xml from my_table mt where something=something');