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 20 November 2006, 04:14 PM
  #1  
ChefDude
Scooby Regular
Thread Starter
 
ChefDude's Avatar
 
Join Date: Aug 2005
Posts: 4,290
Likes: 0
Received 0 Likes on 0 Posts
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?
Old 20 November 2006, 05:05 PM
  #2  
TopBanana
Scooby Regular
 
TopBanana's Avatar
 
Join Date: Jan 2001
Posts: 9,781
Likes: 0
Received 0 Likes on 0 Posts
Default

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

Microsoft DTS which comes with SQL Server can do this
Old 20 November 2006, 05:15 PM
  #3  
ChefDude
Scooby Regular
Thread Starter
 
ChefDude's Avatar
 
Join Date: Aug 2005
Posts: 4,290
Likes: 0
Received 0 Likes on 0 Posts
Default

what about Oracle?
Old 20 November 2006, 05:39 PM
  #4  
TopBanana
Scooby Regular
 
TopBanana's Avatar
 
Join Date: Jan 2001
Posts: 9,781
Likes: 0
Received 0 Likes on 0 Posts
Default

I believe Microsoft DTS can talk to Oracle too. Do you have SQL 2005?
Old 21 November 2006, 10:45 AM
  #5  
cottonfoo
Scooby Regular
 
cottonfoo's Avatar
 
Join Date: Jan 2001
Location: still behind twin turbos
Posts: 469
Likes: 0
Received 0 Likes on 0 Posts
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
ossett2k2
Engine Management and ECU Remapping
15
23 September 2015 09:11 AM
pimmo2000
Computer & Technology Related
2
21 September 2015 12:04 PM
Did
Drivetrain
4
04 October 1999 06:24 PM



Quick Reply: XML to DB table loader help



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