Home » RDBMS Server » Server Utilities » Concatenate records
Concatenate records [message #157184] Tue, 31 January 2006 17:10
bharat.athreya
Messages: 1
Registered: January 2006
Junior Member
Hi Ours is a large application and we use SQL Loader to import the data ( fixed format ) into our DB.. Atleast there will be 500,000 records per file...

my question is :

I've a record like this :

HDR0000400005
ABC8001
DEF8002
GHI8003
ABC8004
DEF8005
GHI8006
....
....
..
TRL0009990008787

I need to elminate the Header record that starts with 'HDR'
and concatenate the immediate 3 records for each iteration. that is ABC,DEF,GHI needs to be appended and inserted and then the next set...finally the trailer record to be handled ( Handling the trailer record is done )....

This is my sample control file that i tried

LOAD DATA
truncate
concatenate 3
INTO TABLE emp_details
when (1:3) = 'ABC'
(
FNAME POSITION(1:3),
ID POSITION(4:7),
MNAME POSITION(8:10),
ID1 POSITION(11:14),
LNAME POSITION(15:17),
ID2 POSITION(18:21)
)

I run this from command line like this :

sqlldr username/password@dbname control=filname.ctl skip=1

It fails....what happens is that the Skip command takes out first 3 lines and not thae First line...

Please help me to resolve this as soon as possible.
Thanks in advance,
Bharat Athreya
Previous Topic: SQL Loader / Eliminate Trailing Last Record
Next Topic: SQL*Loader won't load text over a certain length
Goto Forum:
  


Current Time: Tue Jul 02 04:09:03 CDT 2024