GD,
Question 1: "If I can assume that the contents of the field might fit into any of the date formats you mention, do I just need a big case statement?"
Answer 1: If I were in your predicament, then I would create a function to extract dates from the source column:
Code:
CREATE OR REPLACE FUNCTION scrub_date (rubbish_in varchar2) RETURN DATE IS
scrubbed_date_out DATE;
...
(all the appropriate CASE statements to determine if the string is a DATE. If the code encounters no valid DATE, then return NULL; otherwise return a valid DATE in a proper Oracle DATE expression. Either way, you will ultimately say...)
RETURN scrubbed_date_out;
END;
/
Question 2: "Who should have to
pay (either in time or money) to produce a solution for this problem?"
Answer 2: If my company authored this (non-)application, I would be totally embarrassed to show my face. If this (correctly labeled "Rubbish") is from a supplier, then they should have to underwrite the costs of "un-rubbishing" this particular problem. This is tatamount to "IT Malpractice". If the supplier is unwilling to provide a quality, working fix (at the bare minimum, the code for the above scrub function), then I would get the corporate attorneys involved...not from a cost-effectiveness standpoint, but because of the principle involved: No one should be able to revenue on crap like theirs.
I would be happy to testify as an expert witness in your behalf.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[
Providing low-cost remote Database Admin services]
Click here to join
Utah Oracle Users Group on Tek-Tips if you use
Oracle in
Utah USA.