Is there a way to test if a varchar is cast-able into a int before casting it?
Is there a way to test if a varchar is cast-able into a int before casting it? select (int '3'); works. But I don't know what values I will be getting; I just know that they are supposed to be integers. What I need is something like: select case when isInteger('4') is true then cast('4' as int) else null end as mycolumn;
0
Comments
select regexp_like('abc', '[^0-9]');true
select regexp_like('1234', '[^0-9]');
false