久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='gDbt0'></bdo><ul id='gDbt0'></ul>
  • <small id='gDbt0'></small><noframes id='gDbt0'>

      <legend id='gDbt0'><style id='gDbt0'><dir id='gDbt0'><q id='gDbt0'></q></dir></style></legend>
    1. <tfoot id='gDbt0'></tfoot>

      1. <i id='gDbt0'><tr id='gDbt0'><dt id='gDbt0'><q id='gDbt0'><span id='gDbt0'><b id='gDbt0'><form id='gDbt0'><ins id='gDbt0'></ins><ul id='gDbt0'></ul><sub id='gDbt0'></sub></form><legend id='gDbt0'></legend><bdo id='gDbt0'><pre id='gDbt0'><center id='gDbt0'></center></pre></bdo></b><th id='gDbt0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gDbt0'><tfoot id='gDbt0'></tfoot><dl id='gDbt0'><fieldset id='gDbt0'></fieldset></dl></div>

        使用取自序列的值將屬性添加到 xmltype

        Add attribute to xmltype with value taken from sequence(使用取自序列的值將屬性添加到 xmltype)
          <tbody id='QhT7m'></tbody>

              <i id='QhT7m'><tr id='QhT7m'><dt id='QhT7m'><q id='QhT7m'><span id='QhT7m'><b id='QhT7m'><form id='QhT7m'><ins id='QhT7m'></ins><ul id='QhT7m'></ul><sub id='QhT7m'></sub></form><legend id='QhT7m'></legend><bdo id='QhT7m'><pre id='QhT7m'><center id='QhT7m'></center></pre></bdo></b><th id='QhT7m'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QhT7m'><tfoot id='QhT7m'></tfoot><dl id='QhT7m'><fieldset id='QhT7m'></fieldset></dl></div>
              <legend id='QhT7m'><style id='QhT7m'><dir id='QhT7m'><q id='QhT7m'></q></dir></style></legend>
            • <tfoot id='QhT7m'></tfoot>
                  <bdo id='QhT7m'></bdo><ul id='QhT7m'></ul>

                  <small id='QhT7m'></small><noframes id='QhT7m'>

                • 本文介紹了使用取自序列的值將屬性添加到 xmltype的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我使用的是 11.2 版的 Oracle XE.

                  I am using Oracle XE in version 11.2.

                  我有這樣的 XML:

                  <root>
                      <x a="a"/>
                      <x a="b"/>
                      <x a="c"/>
                  </root>
                  

                  不,我想將屬性 b 添加到每個元素 x ,其值取自序列,但它應該為每個元素采用新值.預期結果是:

                  No I would like to add attribute b to each element x with value taken from sequence, but it should take new value for each element. Expected result is:

                  <root>
                      <x a="a" b="1"/>
                      <x a="b" b="2"/>
                      <x a="c" b="3"/>
                  </root>
                  

                  我發(fā)現(xiàn)要向 XML 添加屬性,我可以使用 insertchildxml 但在將相同的(第一個)值從序列添加到所有屬性 b.我找不到如何為每個單獨的元素 x 調用此函數(shù).

                  I've found that to add attribute to XML I can use insertchildxml but in is adding the same (frist) value from sequence to all attributes b. I can't find how to call this function for each individual element x.

                  我將不勝感激.

                  推薦答案

                  我終于找到了一些解決方案,關鍵是使用 XMLTable() 函數(shù).這是我的代碼:

                  I've finaly found some solution and key to it was to use XMLTable() function. Here is my code:

                  declare
                  v_inXML xmltype;
                    v_tmpXML xmltype;
                    v_withIdXML xmltype;
                    v_outXML xmltype;
                  BEGIN   
                    v_inXML := XMLType('<root><x a="a"/><x a="b"/><x a="c"/></root>');
                    v_withIdXML := XMLType('<root/>'); 
                    v_outXML := XMLType('<root/>');
                  
                    for c_rec in (
                      select *
                      from   XMLTable('for $i in /root/x
                            return $i'
                            passing  v_inXML
                            columns x xmltype path '/x'
                      )
                    )
                    loop
                      select insertchildxml(c_rec.x,'//x', '@b', pckg_ent_pk_seq.nextval) into v_tmpXML from dual;      
                      select insertchildxml(v_withIdXML, '/root', 'x', v_tmpXML) into v_withIdXML from dual;    
                    end loop;
                  
                    select updatexml(v_outXML, '/root', v_withIdXML) into v_outXML from dual;
                  
                    dbms_output.put_line(v_outXML.getClobVal());
                  END;
                  

                  結果是:

                  <root><x a="a" b="92"/><x a="b" b="93"/><x a="c" b="94"/></root>
                  

                  這篇關于使用取自序列的值將屬性添加到 xmltype的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Is there a way to get information about a server using SQL(有沒有辦法使用 SQL 獲取有關服務器的信息)
                  Select SQL Query to get xml node values from ntext column?(選擇 SQL 查詢以從 ntext 列中獲取 xml 節(jié)點值?)
                  How to get first element by XPath in Oracle(如何在 Oracle 中通過 XPath 獲取第一個元素)
                  Select XML element in SQL Server(在 SQL Server 中選擇 XML 元素)
                  Oracle XMLTable- fetching column from parent node(Oracle XMLTable-從父節(jié)點獲取列)
                  XML Parsing on sql server(sql server 上的 XML 解析)
                  • <tfoot id='1bqV6'></tfoot>
                      <tbody id='1bqV6'></tbody>
                    <i id='1bqV6'><tr id='1bqV6'><dt id='1bqV6'><q id='1bqV6'><span id='1bqV6'><b id='1bqV6'><form id='1bqV6'><ins id='1bqV6'></ins><ul id='1bqV6'></ul><sub id='1bqV6'></sub></form><legend id='1bqV6'></legend><bdo id='1bqV6'><pre id='1bqV6'><center id='1bqV6'></center></pre></bdo></b><th id='1bqV6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1bqV6'><tfoot id='1bqV6'></tfoot><dl id='1bqV6'><fieldset id='1bqV6'></fieldset></dl></div>

                  • <small id='1bqV6'></small><noframes id='1bqV6'>

                    <legend id='1bqV6'><style id='1bqV6'><dir id='1bqV6'><q id='1bqV6'></q></dir></style></legend>
                      <bdo id='1bqV6'></bdo><ul id='1bqV6'></ul>

                            主站蜘蛛池模板: 国产女人精品视频 | 国产大学生情侣呻吟视频 | 免费在线观看黄视频 | www.中文字幕 | 国产特级毛片 | 欧美成人激情 | 免费爱爱视频 | 欧美日本在线观看 | 少妇一区二区三区 | 亚洲精品久久视频 | 国产伦精品一区二区三区照片91 | 2018中文字幕第一页 | 国产一区二区三区免费观看在线 | 天堂亚洲 | 精品毛片在线观看 | 91免费观看国产 | 久久精品无码一区二区三区 | 色香婷婷| 神马久久久久久久久久 | 亚洲视频 欧美视频 | 久久久91| 妞干网福利视频 | 在线免费av电影 | 久久久国产精品一区 | 一区二区三区视频在线观看 | 夜夜草天天草 | 日韩一区二区三区在线 | 久久精品久久久久久 | 久久精品av麻豆的观看方式 | 国产在线高清 | 黄色成人在线观看 | 99精品欧美一区二区蜜桃免费 | 亚洲成人午夜电影 | 欧美综合在线观看 | 中文字幕高清av | 精品亚洲视频在线 | 欧美一级片在线看 | 亚洲欧美综合 | 成人av电影网 | 精品久久成人 | 国产精品揄拍一区二区 |