Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Loader NULLIF clause

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I have problem in using the NULLIF clause to set a Numeric field to null If either-
a) it contains blanks or
b) it contains -1

the or is what I couldn't get SQLLoader to work!
Code:
Load Data

infile 'test.dat'

REPLACE
INTO TABLE userData

(

VALUE	POSITION(185:187)	INTEGER EXTERNAL NULLIF (VALUE=BLANKS)
)

I tried or , but no luck!!

 
This is just a guess, but I would try

NULLIF (VALUE in (BLANKS, -1))

If that doesn't work, and you don't want to spend time figuring out the exact syntax, just load the table including the -1 values and execute an update statement later to change -1 to null.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top