Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> sql loader and "OR" in when clause - cross post
Hello,
I'm loading a flat file into a DB using SQL*Loader. I need to load only
rows in which one column is <> to (for example) 'ABC' AND another column is
<> to 'X' OR 'Y'. The rest of the records go to another table - the bulk
will go to the first table.
First I tried to get it to load with only WHEN (col_1 <> 'ABC) AND (col_b
<> 'X') ...forget the OR for now. None loaded, error message said the when
clause wasn't met, though there **were** columns where both conditions were
true. If I said WHEN(col_1 <> 'ABC') AND (col_b = 'X'), I would get those
columns. It seems if I write WHEN col_b <> 'X', I should get the rest. I
did finally (though not thoroughly tested) get loading accomplished with
using the postion of the data in the flat file record, ie WHEN (col_1 <>
'ABC') AND (32:32) <> 'X'. I got that type of syntax off a web faq. And I
found a paragraph stating the when clause can have multiple conditions, and
must be connected with ANDs. Never found a word about ORs. I tried all
sorts of syntax, NOT, NOT IN, etc...but to no avail.
Can this be done? Must be a way!!
Thanks in advance for any help, it's greatly appreciated!!!
Pat Received on Thu Jun 08 2000 - 00:00:00 CDT