SQL*LOADER different types of records

From: K <kristofvdw_at_matt.es>
Date: 22 Oct 2004 06:21:58 -0700
Message-ID: <ef74fcf7.0410220521.ea5effd_at_posting.google.com>



Hi,

[Quoted] I have to extract 3 types of records (header-details-footer, reoccuring) from a flat text file into three tables. The problem is that the only way to distinguish the records is by the number of fields (or maybe even the types), since there is no indicator of recordtype nor fixed record size. I cannot change this design since it is given by an external company. I would need a control file like this one (simplified):

LOAD DATA
APPEND
INTO TABLE TABLE1
WHEN COUNTER = '2'
FIELDS TERMINATED BY X'09'
(

  c1,
  c2
)

INTO TABLE TABLE2
WHEN COUNTER = '5'
FIELDS TERMINATED BY X'09'
(

  c1,
  c2,
  c3,
  c4,

  c5
)

INTO TABLE TABLE3
WHEN COUNTER = '3'
FIELDS TERMINATED BY X'09'
(

  c1,
  c2,
  c3
)

But how do I get the "COUNTER" value?

Any suggestion is more than welcome, I've been struggeling with this one for days already...

TIA,
K Received on Fri Oct 22 2004 - 15:21:58 CEST

Original text of this message