Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a column value contains integers in oracle [duplicate]

Tags:

integer

oracle

Need a query that has to check whether resulting columns have integer.

like image 235
user3020560 Avatar asked Nov 22 '13 06:11

user3020560


1 Answers

First you must know if the value is a number. If it is in a column of type number you don't have to worry about that. To check if the value is an integer you can use the trunc function. This will take the decimal values off.

if trunc(value)= value then
   -- we have an integer
else
   -- we don't
end if;
like image 106
Rene Avatar answered Oct 18 '22 22:10

Rene