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

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

          <bdo id='sEwiF'></bdo><ul id='sEwiF'></ul>

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

        使用 Xquery 檢索 xml 屬性

        Retrieving xml attribute using Xquery(使用 Xquery 檢索 xml 屬性)
          <tbody id='SsGTQ'></tbody>
      1. <i id='SsGTQ'><tr id='SsGTQ'><dt id='SsGTQ'><q id='SsGTQ'><span id='SsGTQ'><b id='SsGTQ'><form id='SsGTQ'><ins id='SsGTQ'></ins><ul id='SsGTQ'></ul><sub id='SsGTQ'></sub></form><legend id='SsGTQ'></legend><bdo id='SsGTQ'><pre id='SsGTQ'><center id='SsGTQ'></center></pre></bdo></b><th id='SsGTQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SsGTQ'><tfoot id='SsGTQ'></tfoot><dl id='SsGTQ'><fieldset id='SsGTQ'></fieldset></dl></div>

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

          <tfoot id='SsGTQ'></tfoot>

          • <legend id='SsGTQ'><style id='SsGTQ'><dir id='SsGTQ'><q id='SsGTQ'></q></dir></style></legend>

                  <bdo id='SsGTQ'></bdo><ul id='SsGTQ'></ul>

                • 本文介紹了使用 Xquery 檢索 xml 屬性的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我使用以下查詢從 XML 文件的屬性 ad 元素中選擇 XML 的值,但我無法從 XML 頁面讀取 seq、id、reported dated 屬性所以任何人請建議如何使用此查詢獲取屬性值.

                  I am using the below query to select the values of XML from attributes ad elements of the XML file but I am not able to read the seq, id, reported dated attributes from XML page so any one please suggest How to get values of attributes using this Query.

                  select a_node.value('(./text())[1]', 'var char(50)') AS c_val,
                  c1_node.value('(./text())[1]', 'var char(50)') AS c_val 2,
                  ca_node.value('(./text())[1]', 'var char(50)') AS c_val3, 
                  d_node.value('(./text())[1]', 'var char(50)') ,
                  e_node.value('(./text())[1]', 'varchar(50)') ,
                  f_node.value('(./text())[1]', 'var char(50)') 
                  FROM @xmlData.nodes('/Reports/x:InquiryResponse/x:ReportData/x:AccountDetails/x:Account') AS b(b_node) 
                  outer APPLY b.b_node.nodes('./x:primarykey') AS pK_InquiryResponse (a_node) 
                  outer APPLY b.b_node.nodes('./x:seq') AS CustomerCode (c1_node) 
                  outer APPLY b.b_node.nodes('./x:id') AS amount (ca_node)
                  outer APPLY b.b_node.nodes('./x:ReportedDate') AS CustRefField (d_node)
                  outer APPLY b.b_node.nodes('./x:AccountNumber') AS ReportOrderNO (e_node)
                  outer apply b.b_node.nodes('./x:CurrentBalance') as additional_id (f_node);
                  

                  編輯:評論中提供的 Xml 片段

                  Edit: Xml Snippets Provided in Comments

                  <sch:Account seq="2" id="345778174" ReportedDate="2014-01-01">
                      <sch:AccountNumber>TSTC1595</sch:AccountNumber>
                      <sch:CurrentBalance>0</sch:CurrentBalance>
                      <sch:Institution>Muthoot Fincorp Limited</sch:Institution>
                      <sch:PastDueAmount>0</sch:PastDueAmount>
                      <sch:DisbursedAmount>12000</sch:DisbursedAmount>
                      <sch:LoanCategory>JOG Group</sch:LoanCategory>
                  </sch:Account>
                  
                  <sch:Account seq="2" id="345778174" ReportedDate="2014-01-01">
                      <sch:BranchIDMFI>THRISSUR ROAD</sch:BranchIDMFI>
                      <sch:KendraIDMFI>COSTCO/RECENT-107</sch:KendraIDMFI>
                  </sch:Account>
                  

                  推薦答案

                  使用 Xml Loose @Variable 解析 XQuery

                  假設有一個與此類似的 Xml 文檔(即具有一個元素上的所有屬性):

                  Assuming an Xml document similar to this (viz with all the attributes on one element):

                  DECLARE @xmlData XML = 
                  N'<Reports xmlns:x="http://foo">
                      <x:InquiryResponse>
                          <x:ReportData>
                              <x:AccountDetails>
                                  <x:Account x:primarykey="pk" x:seq="sq" x:id="id"
                                               x:ReportedDate="2014-01-01T00:00:00" />
                              </x:AccountDetails>
                          </x:ReportData>
                      </x:InquiryResponse>
                  </Reports>';
                  

                  您可以按如下方式抓取屬性:

                  You can scrape the attributes out as follows:

                  WITH XMLNAMESPACES('http://foo' AS x)
                  select 
                      Nodes.node.value('(@x:primarykey)[1]', 'varchar(50)') AS c_val,
                      Nodes.node.value('(@x:seq)[1]', 'varchar(50)') AS c_val2,
                      Nodes.node.value('(@x:id)[1]', 'varchar(50)') AS c_val3, 
                      Nodes.node.value('(@x:ReportedDate)[1]', 'DATETIME') as someDateTime
                  FROM 
                     @xmlData.nodes('/Reports/x:InquiryResponse/x:ReportData/x:AccountDetails/x:Account') 
                     AS Nodes(node);
                  

                  • 屬性不需要 text() 因為它們自動是字符串
                  • 在命名空間中具有屬性是相當不尋常的 - 如果沒有,請刪除 xmlns 別名前綴.
                    • Attributes don't need text() as they are automatically strings
                    • It is fairly unusual to have attributes in a namespace - drop the xmlns alias prefix if they aren't.
                    • 此處為 SqlFiddle

                      編輯 - 解析 Xml 列

                      • 從屬性中刪除的命名空間- 假設你有一個表中的數據,而不是一個變量,因此 APPLY 要求.請注意, OUTER APPLY 將返回空值,例如僅當您有行時有用空 Xml 或缺少 Xml 元素.CROSS APPLY 是常態(即將 xpath 應用于 LHS 表上選定的每一行)
                      • 元素的訪問方式類似于屬性,只是沒有@
                      • Namespace dropped from the attributes -Assumed that you have the data in a table, not a variable, hence the APPLY requirement. Note that OUTER APPLY will return nulls, e.g. useful only if you have rows with empty Xml or missing Xml Elements. CROSS APPLY is the norm (viz applying the xpath to each row selected on the LHS table)
                      • Elements are accessed similar to attributes, just without @


                      WITH XMLNAMESPACES('http://foo' AS x)
                      select 
                          Nodes.node.value('(@seq)[1]', 'varchar(50)') AS c_val2,
                          Nodes.node.value('(@id)[1]', 'varchar(50)') AS c_val3, 
                          Nodes.node.value('(@ReportedDate)[1]', 'DATETIME') as someDateTime,
                          Nodes.node.value('(x:AccountNumber)[1]', 'VARCHAR(50)') as accountNumber
                      FROM 
                          MyXmlData z
                          CROSS APPLY
                      z.XmlColumn.nodes('/Reports/x:InquiryResponse/x:ReportData/x:AccountDetails/x:Account') 
                            AS Nodes(node);
                      

                      更新小提琴

                      從磁盤編輯 Xml 文件

                      這是從磁盤讀取的 xml 文件的相同內容.請注意,一旦您在 XML 變量 (@MyXmlData) 中擁有數據,您就不需要 CROSS APPLY 到任何東西 - 只需提供xpath 選擇合適的節點,然后刮取元素和屬性.

                      Here's the same thing for an xml file read from disk. Note that once you have the data in an XML variable (@MyXmlData) that you don't need to CROSS APPLY to anything - just supply xpath to select the appropriate node, and then scrape out the elements and attributes.

                      DECLARE @MyXmlData XML;
                      SET @MyXmlData = 
                      ( SELECT * FROM OPENROWSET ( BULK N'c:\temp\file3098.xml', SINGLE_CLOB ) AS MyXmlData );
                      -- Assuming all on the one element, no need for all the applies
                      -- attributes don't have a text axis (they are automatically strings
                      
                      WITH XMLNAMESPACES('http://foo' AS x)
                      select 
                          Nodes.node.value('(@seq)[1]', 'varchar(50)') AS c_val2,
                          Nodes.node.value('(@id)[1]', 'varchar(50)') AS c_val3, 
                          Nodes.node.value('(@ReportedDate)[1]', 'DATETIME') as someDateTime,
                          Nodes.node.value('(x:AccountNumber)[1]', 'VARCHAR(50)') as accountNumber
                      FROM 
                            @MyXmlData.nodes('/Reports/x:InquiryResponse/x:ReportData/x:AccountDetails/x:Account') 
                            AS Nodes(node);
                      

                      這篇關于使用 Xquery 檢索 xml 屬性的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)

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

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

                      • <tfoot id='O0Z2E'></tfoot>
                          <tbody id='O0Z2E'></tbody>

                        <legend id='O0Z2E'><style id='O0Z2E'><dir id='O0Z2E'><q id='O0Z2E'></q></dir></style></legend>

                          1. 主站蜘蛛池模板: 日韩一区二区三区在线观看 | 青青操91| 国产精品久久久久久久久免费 | 91视频网址 | 日韩成人在线网站 | 国产伦精品| 激情婷婷| 国产线视频精品免费观看视频 | 久久久久久久久久爱 | 亚洲欧美一区二区三区视频 | 成人欧美一区二区三区在线观看 | 精品国产一区二区在线 | 国产精品国产a级 | 久久精品无码一区二区三区 | 综合久久亚洲 | 国产视频一区二区 | 中文字幕免费 | 三级视频在线观看电影 | 久久久久久亚洲精品 | 日本一区二区三区四区 | 国产精品1区2区3区 欧美 中文字幕 | 爱高潮www亚洲精品 中文字幕免费视频 | 91在线一区 | 国产中文字幕av | 毛片久久久| 三级成人在线 | 久久新 | 亚洲高清在线观看 | 亚洲视频中文字幕 | 国外成人免费视频 | 国产精品一区二区视频 | 黄色一级大片在线观看 | 久久宗合色| 精品国产一区二区三区久久 | 男女又爽又黄视频 | 久草免费视 | 中文字幕一区二区三区乱码图片 | 日日干日日 | 国产亚洲精品久久yy50 | 国产精品精品 | 成人一区二区三区在线观看 |