SELECT RW.* FROM ulqueue ul , XMLTABLE('//Row' PASSING UL.TEXT COLUMNS "Event" CHAR(10) PATH 'Event' , "Reason_Code" CHAR(10) PATH 'Reason_Code' , "Description" CHAR(10) PATH 'Description' ) as rw where ul.id = '[Param.1]' and ul.queuename = '[Param.2]' and rw."Event" = '[Param.3]' and rw."Reason_Code" = '[Param.4]' ;
What should I do to make columnheaders same as XML Nodes?You cannot, the SQL projection has to be known at parse time, in other words column names must be hardcoded in the query.