Subject convert a string to a number in a where clause - without errors
Author Rustam
I think better way is to control input on client.
If this is impossible you can try "spike": write selectable stored procedure with exception handler "when any do ..."