Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

XML to DB table loader help

Thread Tools
 
Search this Thread
 
Old Nov 20, 2006 | 04:14 PM
  #1  
ChefDude's Avatar
ChefDude
Thread Starter
Scooby Regular
 
Joined: Aug 2005
Posts: 4,291
Likes: 0
Default XML to DB table loader help

Anyone know of an app that can do this...

I need to be able to load this sort of thing

<entity>
<att1>dfdffffd</att1>
<att2>rararar</att2>
<att3>qqqq</att3>
</entity>
<entity>
<att1>dfdffffd</att1>
<att2>rararar</att2>
<att3>qqqq</att3>
<att4>qqqq</att4>
</entity>
<entity>
<att2>rararar</att2>
<att3>qqqq</att3>
<att4>qqqq</att4>
</entity>

into a table
col1
col2
col3
col4
col5
col6
col7

i want to be able to map
<att1> to col1
<att2> to col2
etc

but when i parse the xml and an att is not there specify a default for the col

so
defaults when att missing
col1=null
col2="i"
col3=17.2

so that when it parses it doesn't crash out when an xml attribute is missing.

and i want this to be batchable too

any apps out there that will do this for me?
Reply
Old Nov 20, 2006 | 05:05 PM
  #2  
TopBanana's Avatar
TopBanana
Scooby Regular
 
Joined: Jan 2001
Posts: 9,781
Likes: 0
Default

What you're looking for is a simple 'ETL' tool... (Extract, Transform & Load).

Microsoft DTS which comes with SQL Server can do this
Reply
Old Nov 20, 2006 | 05:15 PM
  #3  
ChefDude's Avatar
ChefDude
Thread Starter
Scooby Regular
 
Joined: Aug 2005
Posts: 4,291
Likes: 0
Default

what about Oracle?
Reply
Old Nov 20, 2006 | 05:39 PM
  #4  
TopBanana's Avatar
TopBanana
Scooby Regular
 
Joined: Jan 2001
Posts: 9,781
Likes: 0
Default

I believe Microsoft DTS can talk to Oracle too. Do you have SQL 2005?
Reply
Old Nov 21, 2006 | 10:45 AM
  #5  
cottonfoo's Avatar
cottonfoo
Scooby Regular
 
Joined: Jan 2001
Posts: 469
Likes: 0
From: still behind twin turbos
Default

If you're using Oracle learn how to use sqlldr, it's very powerful. I don't know if it'll transform the XML for you but it'll do everything else. Transforming that XML is a two minute Perl job.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
ossett2k2
Engine Management and ECU Remapping
15
Sep 23, 2015 09:11 AM
pimmo2000
Computer & Technology Related
2
Sep 21, 2015 12:04 PM
Did
Drivetrain
4
Oct 4, 1999 06:24 PM




All times are GMT +1. The time now is 05:08 AM.