Re: SQL loader and "OR' in when clause

From: Mike Dwyer <dwyermj_at_co,larimer.co.us>
Date: 2000/06/08
Message-ID: <rzP%4.22$k42.9279_at_wdc-read-01.qwest.net>#1/1


First, are you defining col_b as a 1-character: col_b position (32:32)? Second, beware of (col_b <> 'X' OR col_b <> 'Y'). All rows will meet this condition, because 'Y' (in col_b) <> 'X', and 'X' (in col_b) <> 'Y'. Third, SQL*Loader uses multiple WHEN's instead of and OR

WHEN col_1 <> 'ABC' AND (32:32) <> 'X'
WHEN col_1 <> 'ABC' AND (32:32) <> 'Y'

But, see second comment above. Do you want this:

WHEN col_1 <> 'ABC' AND (32:32) <> 'X' AND (32:32) <> 'Y'?

"Pat" <patp_at_cpinternet.com> wrote in message news:RED%4.230$wb7.1620_at_newsfeed.slurp.net...
> 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 CEST

Original text of this message