loading xml file using sql*loader (10g) [message #164247] |
Wed, 22 March 2006 09:21 |
dbgirl_smb
Messages: 3 Registered: May 2005 Location: Va
|
Junior Member |
|
|
Hi Everyone....
I have a major problem. I need to use sql loader to load a large XML file into the database. This file contains records for many, many customers. This will be done monthly and the number of records will vary. I want to use sql loader and load to a staging table, BUT SPLIT THE RECORDS OUT and add a sequence. I am having 2 problems.
In the 10g documentation, when you want to split the records you use the BEGINDATA clause and indicate something (like a 0) for each instance of a record. Well my first file has 3,722 records in it. How do I know the number of records in each XML file?
The second problem is that because this is XML, I thought that I could use ENCLOSED BY. But the start tag has an attribute /counter in it and sql*loader doesnt recognize the starting tag. (i.e.: start tag is: </CustomerRec number=1>
end tag is: </CustomerRec> )
So, I used TERMINATED BY '</CustomerRec>'. This will split out the records, but it will NOT include the ending tag of </CustomerRec> and when I use extract, I receive an XML parsing error.
I have tried to get the ending tag using CONTINUEIF and SKIP. But those options are for "records" and not lines.
Does anyone have any ideas for the 2 problems above. I am at my wits end and I need to finish this ASAP. Any help would be apprecited.
Thank you!
|
|
|