Skip to Main Content
  • Questions
  • I need to skip the first row of the csv file as it contains the header information while load that csv file to a table by using sqlloader

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, suneel.

Asked: October 26, 2004 - 12:08 pm UTC

Last updated: February 23, 2005 - 9:13 am UTC

Version: 8.1.7

Viewed 10K+ times! This question is

You Asked

load data

infile 'D:\Eclipse\eclipse\workspace\AbbeyInterface\sqlloader\jobtypes.csv'

append
into table apt_job_types


fields terminated by "," skip 1
( id,job_title,domain,jobtype_des,custom0,custom1,custom2,custom3,custom4,
custom5,custom6,custom7,custom8,custom9)

and Tom said...

$ sqlldr

SQL*Loader: Release 10.1.0.3.0 - Production on Tue Oct 26 11:46:38 2004

Copyright (c) 1982, 2004, Oracle. All rights reserved.


Usage: SQLLDR keyword=value [,keyword=value,...]

Valid Keywords:

userid -- ORACLE username/password
control -- control file name
log -- log file name
bad -- bad file name
data -- data file name
discard -- discard file name
discardmax -- number of discards to allow (Default all)
skip -- number of logical records to skip (Default 0)

load -- number of logical records to load (Default all)
errors -- number of errors to allow (Default 50)
.......




Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

What about Footer

Nikhilesh, February 23, 2005 - 3:28 am UTC

Dear Tom what if do if i want to skip the last line as its a footer.
Thanks in Advance

Tom Kyte
February 23, 2005 - 3:45 am UTC

either use an external table (sql can help you)

or use load=N-1 if you know N (the number of records)

or use a when clause that can filter out the footer based on some data you know must be in the footer.

Dave T, February 23, 2005 - 5:59 am UTC

Tom,

Enjoy Dublin today!

Have a Guiness while you are there.

Tom Kyte
February 23, 2005 - 9:13 am UTC

had 2 pints of it yesterday !

SQL Loader

veera, February 23, 2005 - 7:25 am UTC

If you cannot put any conditions to filter the footer, you let it load and if the table has any NUMBER field, it will not load the record and it will put it in the BAD file. If you put a condition it will put the record in Discard file.