Concatenate fields in sql loader [message #115066] |
Thu, 07 April 2005 03:34 |
alisonseedat
Messages: 2 Registered: April 2005
|
Junior Member |
|
|
Is it possible to concatenate data into one column? For example, for the field record_type, I would like to put in the data from position 2:5 concatenated with data from position 11:12. E.g. in 2:5 there is text '0318' and in 11:12 there is text '05' so I would like field record_type to store '031805'.
(RECORD_TYPE POSITION(2:5),
TRX_DATE POSITION(9:16),
TRX_TYPE POSITION(19:24),
....
)
Any assistance would be appreciated!
|
|
|
|
|
Re: Concatenate fields in sql loader [message #115533 is a reply to message #115066] |
Tue, 12 April 2005 09:23 |
smartin
Messages: 1803 Registered: March 2005 Location: Jacksonville, Florida
|
Senior Member |
|
|
I like the staging table approach myself, but as an exercise to see if you COULD do it in sqlloader, could you perhaps load the field as positions 2:12 (get the whole thing) and then apply a custom function to the load (if memory serves that might limit you to conventional path) that substrings out to just keep the portion you want? You'd still need a separate position line to capture the field in between the two fields you are concatenating.
But, I gotta think this would be slower than a staging table.
|
|
|