Re: Converting integer column from XXXXXN to XXXXXNN
Posted in 1996
Or, slightly more simply: UPDATE Tab_Name 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. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: proberts@lynx.informix.com (Paul Roberts) }Date: 26 Mar 1996 22:56:13 GMT }X-Informix-List-Id: <news.22525> } }In article <4j904d$fp2@a3bsrv.nai.net>, }John Fontanilla <john@a3bgate.nai.net> wrote: }> 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) ; }[...]