title: Check DATE format in Oracle
body: <p>I have below SELECT query in a procedure. I need to add another validation check for SUBMTD_SRVC_DATE column. If the value of SUBMTD_SRVC_DATE is in any format other than 'MMDDYYYY', then I need to populate '00000000'. Suppose, if SUBMTD_SRVC_DATE = '100515', then I need to automatically populate '00000000'.</p>
  
  <p>Could anyone please on that. Thanks in advance.</p>
  
  <pre><code>SELECT CASE WHEN SMS.SRVC_UNITS IS NULL OR SMS.SRVC_UNITS = -8888 OR SMS.SRVC_UNITS = -9999 THEN '0000000' ELSE LPAD( SMS.SRVC_UNITS , 7 , '0') END
                      || CASE WHEN ( SMS.SUBMTD_SRVC_DATE IS NULL OR UPPER(SMS.SUBMTD_SRVC_DATE) = 'NOT AVAILABLE') THEN '00000000' ELSE SMS.SUBMTD_SRVC_DATE END  AS FILE_VAL
  FROM SUBMTD_MED_SRVC SMS
  </code></pre>