Urgent - Loading Data from Comma Sep File(CSV) [message #71763] |
Tue, 07 January 2003 23:52 |
Arfat
Messages: 25 Registered: August 2002
|
Junior Member |
|
|
HI,
I have one file which is comma sepatred
the values are
Arfat,12,India,200.00,Mumbai,Chougulay
The above fields are Name,Age,Country,Salary,City,Surname
Now i have a table with follwing field
Name,Surname,City,Country
i.e while loading i dont want to load Salary and Age
Is there a way to Do it?
Without Changing the Table Structure.
Thanx in Advance
|
|
|
Re: Urgent - Loading Data from Comma Sep File(CSV) [message #71768 is a reply to message #71763] |
Wed, 08 January 2003 06:52 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
1. load all the rows to a dummy table with all the columns
2. now insert only the wanted columns into your target table from the dummy table.
or
use a filler
----------------------------------------------------------------------
LOAD DATA INFILE *
INTO TABLE MyTable
FIELDS TERMINATED BY ","
(
c1 INTEGER,
c2 FILLER CHAR,
c3 CHAR )
BEGINDATA
1,willbeskipped_1,a
2,willbeskipped_2,b
3,willbeskipped_3,c
|
|
|