David Jack Wange Olrik

Tea. Earl Grey. Hot.

Is Numeric?

obstacle10.jpg I have a varchar in a table on an Oracle 8i database, and I wanted to select only those tuples that contain numbers. Had I used PostgreSQL I could just have used a regex, which is nice and Perl like. But this is Oracle and so the “Enterprise solution” to this problem looks loke this: [cc lang=”sql”]select * from dual where length(trim(TRANSLATE(‘NaN’, ‘0123456789’, ‘ ‘))) is null; [/cc] And whenever the above statement is different from null, it is not a number…