Oracle
 sql >> Teknologi Basis Data >  >> RDS >> Oracle

Cara menggunakan fungsi xmlconcat di Oracle

WITH vw_cdic_uci_detail AS ( SELECT 546 AS vcud_lei, 'BMO2100001200001' AS vcud_uci, 50 AS vcud_per FROM DUAL UNION ALL
                             SELECT 546 AS vcud_lei, 'BMO2100005500012' AS vcud_uci, 50 AS vcud_per FROM DUAL
                           )
SELECT XMLELEMENT( "BusProcess",
          XMLFOREST(
             XMLFOREST( '65443W404' AS "CUSIP",
                        100         AS "RUP",
                        2500        AS "ACB"
             ) AS "CRR"
          ),
          XMLELEMENT("LEI", vcud_lei),
          XMLCONCAT( AddModCDIC ) AS "AddModCDIC"
       )
  FROM ( SELECT vcud_lei,
                CASE
                   WHEN 1=1
                   THEN
                   XMLCONCAT(
                      XMLELEMENT("AddModCDIC",
                         XMLELEMENT("CDICData",
                            XMLAGG(
                                     XMLELEMENT("UCIData",
                                        XMLFOREST(vcud_uci AS "UCI",
                                                  vcud_per AS "InterestlnDeposit"
                                  )
                               )
                            )
                         )
                      )
                   ) 
                   ELSE NULL
                END AS AddModCDIC
           FROM vw_cdic_uci_detail
          GROUP BY vcud_lei
      ) a;



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. SQL untuk memeriksa semua nilai di kolom

  2. Bagaimana melakukan operasi batch menggunakan pl/sql

  3. Ambil IDENTITAS yang terakhir dimasukkan Oracle

  4. Aplikasi vs Kumpulan Koneksi Penduduk Database

  5. Pembaruan Oracle Hang