There is a modulus function in DB2, called MOD. It could be used in a
generated column to automatically produce a checkdigit as follows:
CREATE TABLE employeex (name VARCHAR(10),
salary dec(10,2),
mod_sal generated always as (mod(int(salary),7)))
sea wrote:
[color=blue]
> Thank you all so very much for all explanations and ideas about
> checksum, a subject I had no idea about to begin with! Thank you for
> your time and efforts!
>
> ================================================== ======================
>
>
> "PM \(pm3iinc-nospam\)" <PM(pm3iinc-nospam)@sympatico.ca> wrote in message news:<gaFTb.2831$ZN1.211079@news20.bellglobal.com>...
>[color=green]
>>Use
www.google.com and search for
>>modulus 10
>>or
>>luhn
>>ex:
http://utopia.knoware.nl/users/epre...mbers/Luhn.html
>>
>>This is just an example of a well know formula. (check digit)
>>
>>The basic principle is to apply a math function to the data and get a
>>result.
>>If you reapply the same function, you should get the same number again.
>>(data considered the same/good/etc.)
>>
>>Those functions are developped by mathematicians so that the event of a wong
>>positive is reduced.
>>The function may be developped for a fixed length data stream or variable
>>lenght...
>>
>>Of course you can also build your own but you may get sub-optimal/reduced
>>validity checking.
>>
>>
>>PM
>>
>>"sea" <sea_099@hotmail.com> a écrit dans le message de
>>news:f8c6e337.0402021148.4788287b@posting.google.c om...
>>[color=darkred]
>>>I understand that it is possible to test the integrity of data using
>>>something called checksum? What exactly is this and how do I use it in
>>>DB2? I've searched a lot of places but could not find an answer, hence
>>>this question -- thank you very much for any help![/color][/color][/color]