Solved

Oracle loader

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

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SSN Format in Oracle 2 60
CREATE TABLE syntax 4 45
Oracle Next Available Number 2 19
ORA-01008: not all variables bound. 6 17
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example, show how to take different types of Oracle backups using RMAN.
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

760 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

21 Experts available now in Live!

Get 1:1 Help Now