Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace IBM i
Categories Db2 for i
Created by Guest
Created on Aug 23, 2023

Enhnance XMLROW by adding an OPTION of "OPTION EXCLUDE XMLDECLARATION" to this function

When using the XMLROW function, it addes the XML header tag to each returned row. So you end up with <?xml version="1.0" ENCODING="IBM037"?> prefixing each and every row.

IBM ACS and other interfaces strip off that header tag internally. But when using other interfaces, such as RPG IV with embedded SQL (i.e., EXEC SQL FETCH C1 INTO..." the XML header tag is returned.  

Today, developers have to wrap XMLROW in an outer XMLSERIALIZE function and then cast the result of it to some external variable, e.g. "AS VARCHAR(10000)" which isn't always fun. and include an EXCLUDE XMLDECLARATION flag after the serialize function. This makes the SELECT or other statement more confusing and complex. Whereas using a simple XMLROW function is a wonder way to easily generate XML from a "record read into an RPG program".

This Idea is simply requesting that IBM add the EXCLUDE XMLDECLARATION clause to the XMLROW OPTION parameter, similar to how it currently exists on the XMLSERIALIZE function. This way we can (A) avoid wrapping XMLROW in a verbose and seemingly unnecessary clause. (B) Avoid casting the result set to a know datatype and length, and (C) reduce consternation of RPG IV developers who often use SQL only after they've read an article on this or that feature and often "copied code from an article" (which is likely 70+ percent of them). 

SELECT XMLROW(   CUSTNO as "CUSTOMER_ID", CUSTNAME as "CUSTNAME" OPTION EXCLUDE XMLDECLARATION ) from myschema.myfile;

vs

SELECT XMLSERIALIZE( XMLROW(   CUSTNO as "CUSTOMER_ID", CUSTNAME as "CUSTNAME") as varchar(XXXXXX) as CUSTREC ) from myschema.myfile;

Without XMLSERIALIZE we don't have to cast the result to a known datatype and length, so we can just read it into a CLOB or similar that we've setup. 

Thanks! Just a thought.

 

Idea priority Medium
  • Guest
    Reply
    |
    Sep 23, 2023
    IBM does not intend to provide a solution to this Idea at this time, so it is being closed.

    We view this as a minor usability enhancement. The database team has a long list of higher priority requirements, so extending the XML functions to optionally exclude the XML declaration is not likely to be implemented anytime soon. Therefore we are closing this Idea.


    Db2 for i development team
    IBM Power Systems Development