Re: SQL*Loader - only AND's available?

From: Deon de Villiers <tsunix_at_metlife.co.za>
Date: 1996/12/06
Message-ID: <32A8499A.7E7A_at_metlife.co.za>#1/1


Adem Hamidovic wrote:
>
> I'm trying to do a bit of pre-processing before inserting values into
> the table. I can get loader to work using a fixed-length data file,
> but the amount of pre-processing I can do appears to be limited by
> sql*loader. Am I correct in assuming that only AND's are available
> when using WHEN? If so, is there any way I can nest these AND's? I've
> tried something like: when ((condition A) AND (condition B)) AND
> Condition C
>
> but it complains. Because of this, I can only do half the
> pre-processing I wish to. Any help would be appreciated.

Hi Adem

I was astounded to find this to be the way it is! Not being able to use an OR in the when clause seems rather lacking.

The way you get around it, is by having multiple "into table ....." clauses. On each into clause you will then specify your different when clauses. The downside to this is that SQL*Loader reads through the entire input file for each into clause - so if you your input is very big the load will take much longer.

eg.

---
options  (errors=0)
load data
infile '$inpfile'
append preserve blanks
into table acgroup.polbasis_mvt95
when tabelkde = '7E'
(
  BEWDAT                             position(1:9)      char,
  BEWKODE                            position(10:11)    char,
  PAKKIENO                           position(12:16)    char,
  EFFEKDAT                           position(17:23)    char,
  POLSLETL_POLISVNO                  position(25:33)    char,
  SEGTIPE                            position(34:34)    char,
  POLSTATS                           position(35:35)    char,
  TABELKDE                           position(36:37)    char,
  TABELTPE                           position(38:40)    char,
  POPKODE                            position(55:55)    char,
  FREKKODE                           position(80:80)    char,
  AGTBESTR                           position(112:116)  char
)
into table acgroup.polbasis_mvt95
when tabelkde = '7F'
(
  BEWDAT                             position(1:9)      char,
  BEWKODE                            position(10:11)    char,
  PAKKIENO                           position(12:16)    char,
  EFFEKDAT                           position(17:23)    char,
  POLSLETL_POLISVNO                  position(25:33)    char,
  SEGTIPE                            position(34:34)    char,
  POLSTATS                           position(35:35)    char,
  TABELKDE                           position(36:37)    char,
  TABELTPE                           position(38:40)    char,
  POPKODE                            position(55:55)    char,
  FREKKODE                           position(80:80)    char,
  AGTBESTR                           position(112:116)  char
)

Cheers
Deon.



>
> Adem Hamidovic
Received on Fri Dec 06 1996 - 00:00:00 CET

Original text of this message