sql loader - SQLLDR CTL: Load date field received in DDMonYYYY to db fields with formats of YYYYMM or MM/DD/YYYY -


I have the source date data in the format of DDMonYYYY (e.g. 25Jan2014). I am using sqlldr to load the data in two different formats (1) YYY YMM and (2) MM / DD / YYYY in different areas. How do I accomplish this? Thank you.

I think you are putting the data into a varchar2 column, so the lines of control file are required Look at something like this where the data is being covered by the way to change the formatting. First, to change it in a date, then use to_char to format it:

 , DATE_RX_WRITTEN CHAR "to_char (to_date (DATE_RX_WRITTEN, 'DDMONYYYY'), 'YYYYMM')"  

 , DATE_RX_WRITTEN CHAR "to_char (to_date (: DATE_RX_WRITTEN, 'DDMONYYYY'), 'MM / DD / YYYY')"  

If you enable it, consider making a date datatype in the table and change it on the way. This way you can convert it when you select it instead:

 , DATE_RX_WRITTEN DATE "DDMONYYYY"  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -