I hade a csv file named FAR_T_SNSA.csv that i wanted to import in oracle database directly. For this i have done the following steps and it worked absolutely fine. Here are the steps that u vand follow out:
HOW TO IMPORT CSV FILE IN ORACLE DATABASE ?
Create a table in sql with same column name as there were in .csv file. create table Billing ( iocl_id char(10), iocl_consumer_id char(10));
Create a Control file that contains sql*loder script. In notepad type the script as below and save this with .ctl extension, in selecting file type as All Types(*). Here control file is named as Billing. And the Script is as Follows:
LOAD DATA
INFILE 'D:FAR_T_SNSA.csv'
INSERT INTO TABLE Billing
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
iocl_id,
iocl_consumer_id
)
Now in Command prompt run command:
Sqlldr UserId/Password
Control = “ControlFileName”
--------------------------------
Here ControlFileName is Billing.