Validating date format Secure online free sexy chat dating
Sure you can do ALL of that in SQL..you're update statement will be 200 lines long....... yes this can be one of the solution but the update query will look so messed up . I was thinking something like using case statement in update and check for converting date using to_date and handle exception in the case block . I know function will make the thing a lot easier but I need to try all the other options before going for a function lets hope something like this works :-Dthis is my first question ever . Then its leap years based on 100 year and 400 year boundaries...CREATE OR REPLACE FUNCTION MY2DATE (p_str IN VARCHAR2 ,format_picture IN VARCHAR2) RETURN DATEISBEGIN RETURN TO_DATE(p_str, format_picture); EXCEPTION WHEN OTHERS THEN RETURN NULL; END;/Function Created.Elapsed: .78 [email protected] tom, I'm using isdate function provided by you (pasted below) ********** create or replace function isdate ( p_string in varchar2, p_fmt in varchar2 := null) return varchar2 as l_date date; begin l_date := to_date(p_string,p_fmt); return 'TRUE'; exception when others then return 'FALSE'; end; ********** But to my surpise it is taking '20092007' and '2007/2007' to be a valid date and converting it to a date but I want them to be reported as error pl refer below SQLHi Tom, I was just wondering if there is an SQL only solution to validate date values? We have a scenario where 1.5 million records in a staging table have to be validated and date value is stored as a VARCHAR2 column in 'YYYYMMDD' format.
Feeling nice atleast I am knowing some other things as well about Oracle .^(((((0[1-9])|(1\d)|(2[0-8]))\/((0[1-9])|(1[0-2])))|((31\/((0)|(1)))|((29|30)\/((0[1,3-9])|(1[0-2])))))\/((20[0-9][0-9])|(19[0-9][0-9])))|((29\/02\/(19|20)(()|())))$ Hi Use this following Regular Expression Details, This will support leap year also.