0
votes

I have XML data stored in the Employee table column; the datatype is XML in DB2.

A sample:

<employee id="901">
  <name>
    <first>Mubashar</first> 
    <last>Hussain</last>
  </name>
  <office>344</office>
  <salary currency="USD">55000</salary>
</employee>

Now I want to display XML stored data in crystal report and want to design a report to list all employees from this field.

I don't want to XML datasource approach because there are hundreds of employees registered.

Kindly help me how can I parse or display XML data stored in table column or suggest me best approach how can I proceed with XML data listing .

Looking forward your response, professionals.

Thanks & regards,

mHussain

1

1 Answers

0
votes

Your best option is perform a regular-expression search in a sql-expression field:

// {%EmployeeName}
(
    REG_SUBSTR(table.field, '<regular expression here>')
)

I don't have access to DB2, so I can't give you the exact syntax.

More information on DB2's regular-expression support: enter link description here