Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oracle 12c xmdifferent output problem

helooApr 15 2019 — edited Jun 12 2019

my xmltype data in table

<row id='1'><a55 m="45">R1</a55><a55 m="45" s="2">R2</a55><a55 m="45" s="3">R3</a55></row>

i am using below script but it concate all value,how can i separate it by column or give a space if concate all value

SELECT  XMLCAST(XMLQUERY('/row/c55[(@m=''45'')]/text()' PASSING C.XMLCOL RETURNING CONTENT) AS VARCHAR(35)) from table_1 C

existing output

R1R2R3

how can i output it in sepearte column per row.

id     55_1     55_2    55_3

---    ------      -------     --------

1      R1         R2       R3

Comments
Post Details
Added on Apr 15 2019
66 comments
1,075 views