How to get a checksum of a table in VB6

Ziko
02-08-2008, 04:03 PM
Hi
I am copying Table1 to New_Table1 and would like to check for data integrity.
so if I get the checksum of Table1 and New_Table1 I can compare the checksum instead of comparing all the records.

Table1 and New_table1 are in different databases. in my code I have two connections. The size of these table is more than 1 million records.

Thank You,
Ziko

dilettante
02-08-2008, 06:43 PM
To do what you want you would have to write the copy, then read the copy calculating the checksum, then compare that with the checksum of the original file. This is not going to be a cheap process.

If these "tables" are in "databases" I'm not sure what it means to calculate checksums on them.

mkaras
02-08-2008, 08:32 PM
The original poster is already dealing with the write of the recordset to Table 2. Seems that processing time only doubles to read back the whole record set that was just written and perform a compare of the two record sets field by field. That is not too bad a price to get the insurance of data integrity.

And besides that even if a checksum was easy to compute they are still not a fully reliable way to verify data integrity. Only a full compare of data to data can provide 100% validation!! (This is one reason why CRCs and other error checking codes are often used. Checksums are only good for the cheapest and lowest performance checking jobs. i.e. you can see the person waving back from the island a few miles away after a safe crossing of the channel but when you look you cannot quite be sure it is exactly the person you were tracking as opposed to somebody else that was on the boat.

Ziko
02-14-2008, 08:26 PM
I think you understand what I want to do.
Get the checksum of a record then compute the checksum of the whole table.
The checksum of a record can be done by concatenating the data of a row.

My problem is I never done such a thing on Oracle DB, how to concatenate a row, then get the checksum, and add all the rows checksums to have a global checksum of the table.

I am using VB6 ADO to connect to Oracle 10.

Right now I am only comparing the RecordCount of both recordsets after copying the data, but this is still not enough.

I would appreciate any help if someone gives me a hint on how to do this.

Thank You,
Ziko

DougT
02-14-2008, 10:57 PM
Hi
I am copying Table1 to New_Table1 and would like to check for data integrity.

This does beg the question - why? What sort of problem are you anticipating?

Normally I'd expect such checking to be performed when data is transmitted / received over some sort of network. Is this the case with your application? If so, I'd have thought that a record-by-record CRC check as you copy the Table would be sufficient. Presumably if an integrity check fails you'd like to know which record so that it can be re-copied.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum