SQL INTEGER or INT scalar function in DB2 for i SQL

SQL INTERGER or INT scalar function in DB2 for i SQL
SQL INTERGER or INT scalar function in DB2 for i SQL, ibm2 db2, sql function in db2
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

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain