Skip to content

Instantly share code, notes, and snippets.

@arbo-hacker
Last active January 23, 2016 04:53
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save arbo-hacker/cae647d16ee8bda52928 to your computer and use it in GitHub Desktop.
Como saber si el valor de un campo es numerico en PL/SQL
-- Obtener todos los registros que son alfanumericos
select * from (
select '123' campo from dual
union all
select '1X2' from dual
) tmp
where translate(campo,'T 0123456789','T') is not null;
-- Obtener todos los registros que son numericos
select * from (
select '123' campo from dual
union all
select '1X2' from dual
) tmp
where translate(campo,'T 0123456789','T') is null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment