Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Checksum of a string

332 views
Skip to first unread message

brunoalsantos

unread,
May 25, 2011, 11:21:13 AM5/25/11
to
Hello all,

DB2 V9.5 LUW Fixpack 5.

Is there in DB2 a function that returns the checksum of a string, like
the sum of UNIX?

In Unix/Linux:

[db2inst1@JULIANA-PIRES ~]$ echo "Super string bla bla bla" | sum
49605 1

Best regards.

Bruno.

Lennart Jonsson

unread,
May 25, 2011, 3:02:08 PM5/25/11
to
On 2011-05-25 17:21, brunoalsantos wrote:
> Hello all,
>
> DB2 V9.5 LUW Fixpack 5.
>
> Is there in DB2 a function that returns the checksum of a string, like
> the sum of UNIX?
>

Not as far as I know but if you know the algorithm it's possible to
implement your own function, possibly even in sql. I once had the
misfortune having to implement a base64 decoder in sql, not a pretty
sight ;-)


/Lennart

[...]

Helmut Tessarek

unread,
May 25, 2011, 4:18:50 PM5/25/11
to
Hi Bruno,

> Is there in DB2 a function that returns the checksum of a string, like
> the sum of UNIX?
>
> In Unix/Linux:
>
> [db2inst1@JULIANA-PIRES ~]$ echo "Super string bla bla bla" | sum
> 49605 1

No, there are no checksum functions shipped with DB2, but I wrote UDFs for
md5, seeded md5, seeded sha1 and seeded crypt.

http://j.mp/kb9BJL

You will need APR and APR-util to compile the UDFs.

--
Helmut K. C. Tessarek
DB2 Performance and Development
IBM Toronto Lab

brunoalsantos

unread,
May 25, 2011, 5:01:59 PM5/25/11
to

Helmut and Lennart.

Thanks for reply.

Today, we use a shell script + sql commands to get this information
( checksum ).
I will check with my team what solution we´ll use.

Best.

Bruno

0 new messages