Or, slightly more simply:
SET Int_Col = (Int_Col * 10) - 9 * MOD(Int_Col, 10)
It produces the same answer, and has the same version requirements.
Version 5.03 definitely has the MOD function; it is probably present in all
5.0x versions, whether documented or not, and is definitely present in 6.0x
or later versions. On the other hand, the 4.12 Engine gives a syntax error
on the UPDATE statement; it does not support the MOD function.
Jonathan Leffler (jo...@informix.com) #include <disclaimer.h>
}Date: 26 Mar 1996 22:56:13 GMT
}In article <4j904d$...@a3bsrv.nai.net>,
}> We have to convert one of our table's integer column from
}> XXXXXN to XXXXXNN because we need to have 100 records for each
}> XXXXX instead of the 10 we use now.
}> Ex. From 444440 to 4444400
}> From 444449 to 4444409
}You might want to try something like this:-
} update tab_name
} set int_col = ( ( int_col - mod(int_col, 10) ) * 10 ) + mod(int_col, 10) ;