久久久久久久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>
                  

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

                  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() 函數.這是我的代碼:

                  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模板網!

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

                  相關文檔推薦

                  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 節點值?)
                  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-從父節點獲取列)
                  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>

                            主站蜘蛛池模板: 日韩精品视频在线播放 | 一区二区视频在线 | 国产在线成人 | 高潮毛片无遮挡免费看 | 夜夜草av | 玖玖在线播放 | 九九热精品在线观看 | 99爱视频| 国产免费无遮挡 | 91色网站 | 高清不卡av| 青青草国产精品 | 天天摸夜夜操 | 天天看天天干 | 欧美午夜精品久久久久免费视 | 久久久久久久91 | 国产视频三区 | 久久久久久久久国产 | 四虎成人影视 | 中文在线观看免费视频 | 午夜亚洲精品 | 亚洲天堂久久久 | 国产精品高潮呻吟久久 | 欧美三级韩国三级日本三斤在线观看 | 日韩欧美视频 | 成人免费毛片入口 | 在线黄网| 日本欧美精品 | 欧美性猛交xxxx免费看久久久 | 欧美日韩专区 | 亚洲免费久久 | 日韩视频精品 | 亚洲精品综合 | 国产区免费 | 午夜在线观看视频 | 伊人网在线视频 | 三级视频网| 欧洲精品一区 | 日本一区二区不卡视频 | 成人在线免费视频观看 | 黄色免费观看网站 |