Test String is numeric


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. LENGTH(TRIM(TRANSLATE('123b', ' +-.0123456789',' '))); --would return 1
  2. LENGTH(TRIM(TRANSLATE('a123b', ' +-.0123456789',' '))); --would return 2
  3. LENGTH(TRIM(TRANSLATE('1256.54', ' +-.0123456789',' '))); --would return null
  4. LENGTH(TRIM(TRANSLATE ('-56', ' +-.0123456789',' '))); --would return null

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.