Is it possible to use substring function in a SQL Loader control file?
Sure, you can. Your controlfile entry would look something like:
I'm having trouble figuring it out, How do I create the control file when the next column data is also found in the first column of the comma delimited file.
Using this example, how will the control file look like.
----FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(City "substr(:City, 1,9)",
(City "substr(:City, 0,INSTR(:City,' ',1))",
St "substr(:City,INSTR(:City,' ',1)+1)",
On this case the string before the first blank would be stored as the city and the rest from the first space would be stroed as state.
Life is a journey, not a destination!
Click Here to Expand Forum to Full Width