Oracle loader help

Hi ,

I am using sqlloader to load the below file to the table.

The file content is : 1.txt

Started
FirstName,LastName
Craig,G
Simon,R
Finished

I want to skip the header and trailer, for header i can use OPTIONS SKIP line 1 but dont know how to skip
line1,2, and lastline in the file.

My AIM is to load only lines separated by comma.
      
Thanks
LVL 5
magentoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Naveen KumarConnect With a Mentor Production Manager / Application Support ManagerCommented:
OPTIONS(SKIP = 2 ) --> this can be used to skip lines in the header.

For trailers, we can use a condition to skip as shown below. Give it a try to test :

OPTIONS ( SKIP = 2)
LOAD DATA
INFILE 'Ash.CSV' ----> change here accordingly
TRUNCATE
INTO TABLE mytable --> change table name
WHEN (1:8) <> 'Finished'
FIELDS TERMINATED BY ',' Optionally enclosed by '"'
TRAILING NULLCOLS
(
 ...
)

Thanks
0
 
magentoAuthor Commented:
Thanks
0
 
Naveen KumarProduction Manager / Application Support ManagerCommented:
Good and Thanks
0
All Courses

From novice to tech pro — start learning today.