Solved

Oracle loader help

Posted on 2015-01-27
3
181 Views
Last Modified: 2015-02-08
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
0
Comment
Question by:magento
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
ID: 40574569
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
 
LVL 5

Author Closing Comment

by:magento
ID: 40597766
Thanks
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 40597797
Good and Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Oracle 12c 10 100
Cannot open form error 6 47
Oracle TEXT search question 9 27
VB.Net - CSV to Oracle table 4 27
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now