Avoid obscure SQL error for non-numeric IDs