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

                            主站蜘蛛池模板: 在线观看黄免费 | 欧洲一区二区视频 | 国产精品成人在线播放 | 久久久久久99 | 国产成人一区 | 一区二区三区中文字幕 | www.久| 中文字幕人成乱码在线观看 | 久久1区 | aaa在线 | 中文一区| 亚洲免费视频一区二区 | www.日本在线播放 | 国产视频一区二区在线观看 | 久久一区二区三区免费 | 99热在线免费 | 久久亚洲欧美日韩精品专区 | 午夜精品一区二区三区在线观看 | 欧美激情精品久久久久久 | 久久久久久久一区 | 中文字幕一区二区三区四区五区 | 拍真实国产伦偷精品 | www.日韩免费 | 亚洲午夜精品 | 中文字幕 亚洲一区 | 久久99深爱久久99精品 | 在线黄 | 国产精品久久久久久久久久久久午夜片 | 成人精品国产免费网站 | 国产一区高清 | 国产最新视频在线 | 浴室洗澡偷拍一区二区 | 日本亚洲一区 | 91在线视频| 99亚洲精品 | 99re国产 | 天堂久久久久久久 | 亚洲国产小视频 | 欧美一级视频免费看 | 国产激情视频在线观看 | 黄免费观看 |