Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using SQL LOADER in Oracle to import CSV file

941118Jun 1 2012 — edited Jun 5 2012
I'm pretty new to databases and programming. Im not very good with the computer lingo so stick with me. I have a csv file that I'm trying to load into my oracle database. It contains account information such as name telephone number service dates ect. I've installed Oracle 11g Release 2. This is what I've done so far step by step..

1) Ran SQL Loader

I created a new table with the columns that I needed. For example

create table Billing ( TAP_ID char(10), ACCT_NUM char(10), MR_ID char(10), HOUSE_NUM char(10), STREET char(30), NAME char(50)

2) It prompted me that the Table was created. Next I created a control file for the data in notepad which was located in the same directory as my Billing table and has a .ctl extension. GIS.csv is the file im getting the data from and is also in the same directory and named it Billing.ctl, which looked like so..

load data
infile GIS.csv
into table Billing
fields terminated by ','
(TAP_ID, ACCT_NUM, MR_ID, HOUSE_NUM, STREET, NAME)

3) Run sqlldr from command line to use the control file

sqlldr myusername/mypassword Billing.ctl

This is where I am stuck. Ive seen video tutorials of exactly what I'm doing but I get this error:

SQL*Loader-350: Syntax error at line 1.
Expecting keyword LOAD, found "SERV TAP ID". "SERV TAP ID","ACCT NUMBER","MTR ID","SERV HOUSE","SERV STREET","SERV ^'

I dont understand why its coming up with that error. My billing.ctl has a load.

load data
infile GIS.csv
into table Billing
fields terminated by ','
(TAP_ID, ACCT_NUM, MTR_ID, SERV_HOUSE, SERV_STREET, SERV_TOWN, BIL_NAME, MTR_DATE_SET, BIL_PHONE, MTR_SIZE, BILL_CYCLE, MTR_RMT_ID)

Any thoughts?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2012
Added on Jun 1 2012
7 comments
13,996 views