Solved

Oracle loader help

Posted on 2015-01-27
3
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

635 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