Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

insertion of records from one database to another using xml  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks!can anyone tell me how to insert records from one database (sql server) to another(oracle) using xml.
tell me what r needed to successfully do this operation.
thanks in advance
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know how to retrieve data from SQL server.
But I know how you can do it if you want to retrieve data from Oracle and put it in sql server,
Using Jdeveloper I can create new xsql object to retrive the data, like
<xsql:query connection ="Connection1" xmlns:xsql="urn racle-xsql">
SELECT field1,field2,....
FROM table1
</xsql:query>
This will give me XML file in
<ROW NUM>
<ROW>
.....
format.
then I write XSLT to convert this into another XML which will create the sciprt for inserting this data in new databse
say,
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl utput method="text"/>
<!-- Root template -->
<xsl:template match="/">
INSERT INTO table2 values(
<xsl:for-each select="ROWSET/ROW">
<xsl:value-of select="FIELD1"/>,
<xsl:value-of select="FIELD2"/>,
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Notice that I have written output method as "text" so this creates text file which i can save and use for inserting in anywhere!!!
I can pass o/p from the first one to this xslt either manually by the oraxml utility or directly with another xsql.
I know the xsql allows me to retrieve data from oracle so it is easy.
Dont know if there is anything similar that sqlserver supports.
Sorry about that.
DO let me know if it helped you or confused u
also if you find suitable thing in sqlserver just post it here so all of us will know too!!!
Thanks,

[This message has been edited by Ajith Kallambella (edited May 25, 2001).]
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to take a look at XML support by Oracle on the Oracle Technet site . They have some interesting and very cool tools!
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!