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
Solved

Oracle loader

Posted on 2011-02-15
3
1,088 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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…
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 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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

837 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