How to load tabbed data lines for specific header [message #469650] |
Thu, 05 August 2010 06:42 |
mastu
Messages: 3 Registered: August 2010 Location: Bangalore, India
|
Junior Member |
|
|
Hi,
I have requirement of loading a part of the flat file that contains many headers and lines info. The program has to load the lines whose header recrd_type is 05 using SQL*LOADER.
Any idea?
Mastu
eg of flat file.
Header
trans_code comp date rec_type
------------------------------------------------------------
8 12800002 07292010 05
transcode_line acct date refrence
------------------------------------------------------------
4 4246040010027383 07272010 24427330207710017569675
4 4246040010027383 07272010 24427330207710017569675
[Updated on: Thu, 05 August 2010 06:45] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: How to load tabbed data lines for specific header [message #469799 is a reply to message #469650] |
Thu, 05 August 2010 17:30 |
|
Barbara Boehmer
Messages: 9101 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
You can use a when clause:
when rec_type = '05'
to tell it which ones to load.
The rest depends on your data and what you want loaded. I would need to see some more data, some info about the data such as whether the number of lines for each section is the same, and the structure of the target table and a sample of what results you want to see in the target table, based on the sample data. If the number of rows are consistent, then you can use that. If not, then you can separate the records by a delimiter such as the word "header" if it is actually there in the data and treat the detail rows as arrays if they need to be loaded. These are just a few ideas. There are always multiple ways to do things.
|
|
|