SQL INTERGER or INT scalar function in DB2 for i SQL |
INTEGER or INT
The INTEGER function returns an integer value of either a number or a character/graphic string of integers.
Numeric to Integer
INTEGER(numeric-expression)
Or
INT(numeric-expression)
Example#1
SELECT integer(10.5) , int(11) FROM SYSIBM.SYSDUMMY1
INTEGER ( 10.5 ) INT ( 11 ) 10 11
String to Integer
INTEGER(string-expression)
Or
INT(string-expression)
Example#2
SELECT integer('10.5') , int('11') FROM SYSIBM.SYSDUMMY1
INTEGER ( '10.5' ) INT ( '11' ) 10 11