title: Safe casting VARCHAR to DECIMAL in Teradata
body: <p>In Teradata DB I have source table</p>
  
  <pre><code>create set table SRC_TABLE (
      Some_Id varchar(2O) not null
  );
  </code></pre>
  
  <p>This table is loaded with data from external system. I have target table</p>
  
  <pre><code>create set table DST_TABLE (
      Some_Id decimal(4,0) not null
  );
  </code></pre>
  
  <p>I need to copy rows from SRC_TABLE to DST_TABLE safely. There is a contract in place that external system will provide only values convertible to DECIMAL(4). However, is there any safe way how to select rows in SRC_TABLE which are not compliant with contract and may cause  typecasting failure?</p>
  
  <p>Update: I cannot use UDF functions due to restrictions in environment I am working in.</p>