Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
Looking for SQL Checksum function |
Mon, Jul 23 2007 5:05 PM | Permanent Link |
Dave Harrison | I am looking for a way that would allow me to run a checksum on a string
using SQL. I thought there would be some sort of checksum functions (doesn't have to be MD5) available like there are in other databases. I know I can do it in Delphi code using one of the many checksum functions that are available, but it would be much easier with SQL. Any suggestions? Dave |
Mon, Jul 23 2007 6:08 PM | Permanent Link |
Eryk Bottomley | Dave,
> I am looking for a way that would allow me to run a checksum on a string > using SQL. I thought there would be some sort of checksum functions > (doesn't have to be MD5) available like there are in other databases. I > know I can do it in Delphi code using one of the many checksum functions > that are available, but it would be much easier with SQL. Any suggestions? You'll need a custom SQL function for that I think. The implementation is simple though: Result := dbisamcr.MD5DigestToString(dbisamcr.MD5String(AString)); Eryk PS: You can execute: SELECT RecordHash AS CheckSum FROM MyTable ....and get the MD5 digest of a record ...but that doesn't help with an arbitrary string value. |
Mon, Jul 23 2007 6:19 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dave,
<< I am looking for a way that would allow me to run a checksum on a string using SQL. I thought there would be some sort of checksum functions (doesn't have to be MD5) available like there are in other databases. I know I can do it in Delphi code using one of the many checksum functions that are available, but it would be much easier with SQL. Any suggestions? >> You can do so via a custom function (accepts string and returns string) and by referencing the following functions in the dbisamcr unit included with DBISAM 4.x: function MD5String(const AString: AnsiString): TMD5Digest; function MD5DigestToString(const ADigest: TMD5Digest): string; -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, March 28, 2024 at 08:36 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |