Solved

Oracle loader

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

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 76

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

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

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…
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 explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

776 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