title: Sybase IQ: Converting a string to NUMERIC without error/exception
body: <p>I'm using Sybase IQ and need to convert a field from string to NUMERIC. The field sometimes has characters other than digits. In those cases I want it to return 0 instead of raising exceptions. How to do so?</p>
  
  <p>You may look at the statements below to understand more:</p>
  
  <pre><code>SELECT CONVERT(NUMERIC(10, 0), '');
  SELECT CONVERT(NUMERIC(10, 0), '1');
  SELECT CONVERT(NUMERIC(10, 0), 'a');
  SELECT CONVERT(NUMERIC(10, 0), 'a1');
  SELECT CONVERT(NUMERIC(10, 0), '1a');
  </code></pre>
  
  <p>Only the first 2 lines will work. The remaining 3 lines will raise exceptions:</p>
  
  <pre><code>Cannot covert a to a NUMERIC(10, 0)(07006,-157)
  </code></pre>
  
  <p>Thanks in advance!</p>