Toad World® Forums

Testing XML output


#1

Hello,

I am trying to use code similar to that below to test the output of a call (using the “contains” phrase for a varchar output field). I receive an unexpected error. I am currently using version 1.6, but should soon upgrade to version 1.8. Is there anyway to check the XML generated as an output?

Thank you for your assistance!

SELECT XMLSERIALIZE
( CONTENT
XMLElement(“section”,
XMLAttributes('Section Header ’ as “name”),
xmlelement(“header”,xmlagg(xmlcolattval(a.fld1 as “Fld1”,a.fld2 as “Fld2”))),
XMLAgg
(XMLColattval(a.fld3 as “Fld3”, a.fld4 as “Fld4”))))
FROM tbltest a
WHERE a.pk = value;


#2

Here is my suggestion:

Put the query inside a function. The function returns the XML document. You can then test this function with our built-in XML tests - yes, we offer these and I think you will find what you need there.

Simply use the new (1.8) Outcome Wizard and it will step you through your choices.

Steven Feuerstein
Code Tester Architect