Unanswered: Re: using translate for date in the control file !!
I am having data file where in i expect date but get non-numeric character.
I am generating control file dynamically (programatically).
While creating control file i know that here the type of data will be date so i put datatype as date. But at one place i got non numeric character instead of date.
Now i want to put somekind of logic built in my dynamic generation which will check whether if value within that column is character then make it null and then load data. And if it is numeric keep it as it it.
make value null before loading.
keep the value as it and then load it.
I heard that with translate function we can do that. Right ?
So if i have a line like this in my control file:
column_Name date "MM/DD/YYYY HH:MIS AM"
How should i write the above statement to put the above mentioned logic.
I got it my problem solved.
Actually i was thinking that i will have to check the presence of character and then do translation but i am able to do the translation writing generic translation like this.
"ColName Date "MM/DD/YYYY HH:MMS AM" Translate('ColName','abcdefghijklmnopqrstuvwxywABC DEFGHIJKLMNOPQRSTUVWXYZ','')"
So whenever there are some characters instead of date they are replaced by null.