|
-
I am trying to load the content of a datafile to a database table. The problem is that my datafile has more columns than the database table. Here is an example,
datafile in .csv format, the first row in the .csv file contains the column headers that describes the column.
-------------------------------------------------------
interest rate, loan number, current balance,coupon , date,
6.4, 1000, 34455.00, 9.3, 20100101
7.8, 1001, 34343.43, 8.9, 20100530
and suppose my database table 'LOAN' has only 4 columns
-------------------------------------------------------------------
{
loan_number,
interest_rate,
cur_bal,
date
}
From the above, you can see that I have to skip the first row, and also the fourth column "coupon" in the .csv file. Besides that, I will also need to make proper mapping between the datafile column and the database column since the order they appear in the datafile is different from .
ie,
"loan number" column in .csv TO 'loan_num' column in database
"current balance" column in .csv TO 'cur_bal' column in database, etc...
Does anyone know how to skip columns in the datafile? Any help will be greatly appreciated.
Thanks.
thg.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|