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!

Reg:xmlagg union

chandra_1986Apr 30 2020 — edited Apr 30 2020

Hi experts,

select

TO_CHAR(EVENT_MINUTE, 'MM-YYYY') AS EVENT_MINUTE,

-- select substr( XMLCast( XMLAgg(XMLElement(e, ','||APPLICATION)order by APPLICATION)as clob), 2) APP_LIST from stats_track_summary_by_min

PROCESS_NAME,contract as contract_list from (select

  substr(

    XMLCast(

      XMLAgg(

        XMLElement(e, ','||CONTRACT)

        order by CONTRACT

      )

      as clob

    ), 2

  ) CONTRACT_LIST from stats_track_summary_by_min where process_name='ws_router'

 

  union all

  select contract from stats_track_summary_by_min where process_name!='ws_router' ),

While executing above query am getting below error,  please provide your suggestion how can be modified to get  union for contract list only process_name ='ws_router

and not for other process listagg is not working as lots of record sin table.

ORA-01790: expression must have sa

me datatype as corresponding expression

  1. 00000 - "expression must have same datatype as corresponding expression"

*Cause:   

*Action:

Error at Line: 93 Column: 3

This post has been answered by Paulzip on Apr 30 2020
Jump to Answer
Comments
Post Details
Added on Apr 30 2020
9 comments
464 views