简体   繁体   English

如何进行数据挖掘并将数据插入 sql db?

[英]How can i do data mining and insert data into sql db?

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <ns:GetTrans>
             <ns:return>

        <ns:return>code: 123
     msg: DOWNLOADED SUCCESSFULLY
     Benef Name: Sofi Anna
     Benef COntact No: null 123
     Benef Address: Tokyo
     Benef Account No: 123456789
     Sender Name: Ronaldo  sis
     Sender Address: jpn
     Sender Contact No:  12345678 null
     Authorized Date: 2014-03-27
     Remarks: null
     Remit Type: cash
     AMount: $5000.0
     Branch Details : abc York</ns:return>

      <ns:return>code: 123
     msg: DOWNLOADED SUCCESSFULLY=
     Benef Name: Selena Gomez
     Benef COntact No:  123
     Benef Address: New York
     Benef Account No: 987654321
     Sender Name: Messi  sis
     Sender Address: Banglore
     Sender Contact No:  987654321 
     Authorized Date: 2015-01-20
     Remarks: null
     Remit Type: cash
     AMount: $10000.0
     Branch Details : Canada Brisben

     </ns:return>
      </ns:GetTrans>
       </soapenv:Body>
    </soapenv:Envelope>

I have these response from APIserver in XML...How can I get each data from respective column because it does not have elements and all data in same node??我有这些来自 APIserver 的 XML 响应......我怎样才能从相应的列中获取每个数据,因为它在同一节点中没有元素和所有数据? I have to insert into SQL like:我必须插入到 SQL 中,例如:

Benefname Benef address Amount
Sofi      Tokyo        50000
Selena    Japan        10000

Hi a different way i solution.嗨,我以不同的方式解决。 copy+paste your xml code and create veri.xml复制+粘贴您的 xml 代码并创建 veri.xml

在此处输入图片说明

I m asp code vbscript我是asp代码vbscript

<% @ LANGUAGE = VBScript %>
<%
Set objFSO = CreateObject("Scripting.FileSystemObject")
rootPath = Server.MapPath("veri.xml")
Set objFile = objFSO.OpenTextFile(rootPath,1)%>


<%
'Null value skipline

objFile.SkipLine
objFile.SkipLine
objFile.SkipLine
objFile.SkipLine
objFile.SkipLine
'____

 Do  Until objFile.AtEndOfStream


    strLine = objFile.ReadLine

    strLine=replace(strLine,"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"">","")
    strLine=replace(strLine,"<soapenv:Body>","")
    strLine=replace(strLine,"<ns:GetTrans>","")
    strLine=replace(strLine,"<ns:return>","")


    strLine=replace(strLine,"</soapenv:Body>","")
    strLine=replace(strLine,"</ns:GetTrans>","")
    strLine=replace(strLine,"</ns:return>","")
    strLine=replace(strLine,"</soapenv:Envelope>","")




    strLine=replace(strLine," code",";code")

    alanlar = Split(strLine, ";")
    adet = Ubound(alanlar)

    For i = 0 To adet
        response.write ("<br>") 

        Response.Write alanlar(i)
    Next


Loop

objFile.Close
%>

And result结果

在此处输入图片说明

you can configure yourself你可以自己配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM