Solved

Oracle loader help

Posted on 2015-01-27
3
190 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

910 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

24 Experts available now in Live!

Get 1:1 Help Now