Validate datatype stored in VARCHAR2 column

57 Views Asked by At

I need to validate datatype and flag if it's NUMBER or DATE. For e.g. the data in table looks like:

COL_VALUE
----------          
'ABC',              
'123',              
'10/23/2024',       
'1/1/2025 10 PM'    
'1/2/2000 10:10:10', 
'100.23'            
'23,33,33.30'       

I need output something like:

COL_VALUE                 IS_NUMBER          IS_DATE
------------------------------------------------------------------
'ABC',                          N               N   
'123',                          Y               N
'10/23/2024',                   N               Y
'1/1/2025 10 PM'                N               Y
'1/2/2000 10:10:10'             N               Y
'100.23'                        Y               N   
'23,33,33.30'                   Y               N 

So far, I've tried VALIDATE_CONVERSION function, however, I would like to know if there are better ways to accomplish the data type check.

0

There are 0 best solutions below