ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Xmlserialize

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Xmlserialize

    Hello,

    With this SQL in RPG I'm using it to creat a clob in the IFS:

    SELECT XMLSERIALIZE(XMLDOCUMENT(
    xmlelement(name "list",
    xmlelement(name "cuso", a.cuso),
    xmlagg(xmlelement(name "line", b.ordl55) order by b.ordl55))
    ) as varchar(10000) ccsid 37)
    as response
    INTO :ResultCLOB
    FROM tedi36pf a, oep55 b
    where a.cono = '60'
    AND b.cono55 = a.cono
    AND b.ordn55 = SUBSTR(a.cord, 3, 7)
    group by a.cuso

    Click image for larger version

Name:	Captura de ecrã 2022-02-24 162132.jpg
Views:	60
Size:	105.1 KB
ID:	157106

    Only the first line is in the XML, how can I group it in a higher lever tag like "group" for example?


    FIle B has multiple records per each of file A

    Click image for larger version

Name:	Captura de ecrã 2022-02-24 162545.jpg
Views:	60
Size:	57.1 KB
ID:	157107

    Any help would be appreciated

    regards
Working...
X