Solved

Oracle loader

Posted on 2011-02-15
3
1,096 Views
Last Modified: 2012-06-27
Experts... how do I load data using sql loader when the column in my data file is not null.
ie. I want to load the records based on the column if it is not null else reject that record.
can you please provide me a working script.?
0
Comment
Question by:chickanna
[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 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 34897437
I'm not sure we can do this at a sql*loader level.  Can you add a 'not null' constraint on the table in question?  This should cause the rows to be rejected but only do this if other apps might also insert nulls.

I'll see if I can find a way to cause sql*loader to do this.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 350 total points
ID: 34897603
Learned something new today.  There is a pretty simple way.

use a WHEN clause
LOAD DATA 
INFILE          *
APPEND
INTO TABLE tab1
WHEN col1 <> ''
FIELDS TERMINATED BY ','
(
  col1,
  col2
)
begindata
a,b
a,

Open in new window

0
 

Author Closing Comment

by:chickanna
ID: 34897760
Thanks a lot.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

691 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