Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    12

    Answered: Migration of XML functionality from Oracle to DB2 LUW (ver 9.7 on AIX)

    Hello,
    We are trying to migrate a set of Oracle PL/SQL's to DB2. We have set the Oracle compatibility vector in the db2 configuration parameters, but we are facing issues in instances where an xml file is being read in the Oracle PL/SQL code, eg:-
    v_parser dbms_xmlparser.Parser;
    v_doc dbms_xmldom.DOMDocument;
    v_nl dbms_xmldom.DOMNodeList;
    v_n dbms_xmldom.DOMNode;
    v_parser := dbms_xmlparser.newParser;

    The above sort of code does not compile in a db2 Stored Procedure, throwing error for "dbms_xmlparser" (Object not found). As per my understanding, the best approach would be to develop an equivalent code using pureXML to load the xml file into a temporay or staging table and read it from that table. Is it possible to federate on an xml file and use it as an alias directly?
    All thoughts/inputs are welcome.

    Cheers
    Ashwin

  2. Best Answer
    Posted by n_i

    "Why not use UTL_FILE to read your XML file into the procedure itself?

    PS. You may want to use more recent version of DB2, as Oracle compatibility has significantly improved since v9.7"


  3. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Why not use UTL_FILE to read your XML file into the procedure itself?

    PS. You may want to use more recent version of DB2, as Oracle compatibility has significantly improved since v9.7
    ---
    "It does not work" is not a valid problem statement.

  4. #3
    Join Date
    Sep 2009
    Posts
    12
    Hi n_i,
    Thanks for the useful pointers. On further analysis I found that the input was a XML string as a VARCHAR, to handle that I ended up using XMLPARSE to convert the input character string to an XML and then used the XMLTABLE to read the contents of the XML as a table.

    Regards
    Ashwin

Posting Permissions

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