Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1098
  • Last Modified:

Oracle loader

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
chickanna
Asked:
chickanna
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
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
 
slightwv (䄆 Netminder) Commented:
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
 
chickannaAuthor Commented:
Thanks a lot.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now