I am trying to insert an Content of an XML String into an Table.
XMLString:
<prlnno>10</prlnno><prno>0010062733</prno><price>1100</price><qty>35</qty><descript>This is line item one…</descript>
<requestor>Requestor1</requestor><prlnno>20</prlnno><prno>0010062733</prno><price>1100</price><qty>35</qty><descript>This is line item two…</descript>
<requestor>Requestor2</requestor><prlnno>30</prlnno><prno>0010062733</prno><price>1100</price><qty>35</qty><descript>This is line item three…</descript>
<requestor>Requestor3</requestor>
I need to insert this in an Table called “WMPRDT” and it has the following fields.
PRLNNO
PRNO
PRICE
QTY
DESCRIPT
REQUESTOR
Following are my Steps:
stringToDocument
documentToRecord
insert
But somehow if i am having more set of Tag repeats i am getting the following Error,
[Microsoft][SQLServer 2000 Driver for JDBC]Unable to determine the type of the specified object.
Can anyone give an Suggestion for me in this regards , so that i can insert the above XML String as Three Records as the Tag.
The PRLNNO and Requestor fields will appear in each and the qty data will be different. Iterate through the document list and insert each record. Will this work?
You mean that , stringToDocument Service should be used to create the Document List.
If not , Could you please guide me , for creating the Document List for the same.
The string to document service will take your xml file string and convert it to a node. Then you have to use document to record to obtain a record structure that matches your xml file structure. You should probably create a document (record) that represents the xml document. You can use the xml file to generate this, but the dtd is better and using a schema (xsd) file is best.
Then, you will map the contents of the new document that represents your xml file contents to the data structure that represents each record for insertion in the database.
I will not be able to look at this until later. Please advise of your email address and I will send this to you. I am working on v6.01 and will need to fire up v4.6 to look at this and cannot do so until later this evening. I am in Australia, GMT +10. Thanks.
I’ll need some sample data from you. Also, I had to load my commerce one package. I used the newer version, which has a different path than the one you are using.
Hi Ray,
Thanks for your quick reply.
Here you go for the sample data…
Also i think you are aware of my table structure…
regards
Ramesh
XMLString:
<prlnno>10</prlnno><prno>0010062733</prno><price>1100</price><qty>35</qty><descript>This is line item 111one…</descript><requestor>ramesh111</requestor>
<prlnno>20</prlnno><prno>0010062734</prno><price>1200</price><qty>36</qty><descript>This is line item 222one…</descript><requestor>ramesh222</requestor>
<prlnno>30</prlnno><prno>0010062735</prno><price>1300</price><qty>37</qty><descript>This is line item 333one…</descript><requestor>ramesh333</requestor>
<prlnno>40</prlnno><prno>0010062736</prno><price>1400</price><qty>38</qty><descript>This is line item 444one…</descript><requestor>ramesh444</requestor>
<prlnno>50</prlnno><prno>0010062737</prno><price>1500</price><qty>39</qty><descript>This is line item 555one…</descript><requestor>ramesh555</requestor>
<prlnno>60</prlnno><prno>0010062738</prno><price>1600</price><qty>40</qty><descript>This is line item 666one…</descript><requestor>ramesh666</requestor>
I’m starting to understand a little. The first package you uploaded is not complete or correct. The second package that you uploaded doesn’t seem to have anything to do with the above xml string.
Use the above xml example to create a record structure in the integration server environment. Make sure that the xml is fully qualified and not a snippet like above.
Then, string to document, document to record.
Loop through the multiple record sets. Within the loop, you will insert the data in the database.