generate xml from flat file [message #258750] |
Mon, 13 August 2007 09:14 |
soujanya_srk
Messages: 111 Registered: November 2006 Location: HYDERABAD
|
Senior Member |
|
|
i have a requirement that i have no idea what to do
i have a csv file, with data somewhat like this
"1","1","47784","mycol","mycol","user112",,,, --for company data
"2","1","mpay","John","smith",....-- user data
and tables for company and user
a user belongs to company
CREATE TABLE companyDATA (
ORG_ID NUMBER (16) NOT NULL,
INTERFACE_ID NUMBER (2) NOT NULL,
ORG_DATA_XML CLOB,
STATUS NUMBER (2))
CREATE TABLE userDATA (
USER_ID NUMBER (16) NOT NULL,
INTERFACE_ID NUMBER (2) NOT NULL,
USER_DATA_XML CLOB DEFAULT EMPTY_CLOB(),
STATUS NUMBER (2))
now i have to write a script to create the xml in the
attached format, and insert this xml into the clob column
can anyone give me hint, or reference to any similar script,
or advice about how to go about it..
i have no clue
1) creating a company xml, and user xml
2) inserting into the clob columns of both the tables,
the respective xmls
any help would be greatly appreciated
-
Attachment: company.xml
(Size: 0.88KB, Downloaded 454 times)
|
|
|
|
Re: generate xml from flat file [message #259329 is a reply to message #258754] |
Wed, 15 August 2007 01:22 |
tarmenel
Messages: 63 Registered: February 2007 Location: Israel
|
Member |
|
|
Do you need to first load the data from the CSV into the the database? If so I would recommend looking into SQL*Loader, I use it from the application side and it works well. As far as I know you can use it to load data. This data can be loaded into a temporary table and then you can query the temporary table like Michel showed. this can then be inserted into your tables that you need.
|
|
|
|
|