Hello list,
Recently we have had numerous applications wanting to create XML. Sometimes the data comes from DB2 and in other cases, it comes from other sources (or a combination of the above). So people are writing code in their individual programs to escape the 5 characters that need to be escaped for XML (' " & < >)
I was wondering if IBM had a DB2 function to do this conversion. If not I thought I would write a UDF (called ESCAPE4XML), so people could use a common function like ESCAPE4XML(col1). But I don't it's going to be simple because column names could vary in size from anywhere between 35 CHAR to 120 and then there is VARCHAR going up to the 1000's. Would one size fit all methodology cost us on application performance?
I am just thinking out loud looking for ideas/best practices. I would appreciate any input you could provide... Thanks for your time.
Environment: DB2 v8 for z/OS