Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to generate unique numbers/keys to replace a lengthy a concatenated key in the load script.
The unique number should be consistant and should persist reloads across different files. I'm not sure if autonumber() meets the requirement. I remember reading that it does not retain uniqueness. please advice.
Use Hash128/160/256. These functions has a very low chance of colision
Use Hash128/160/256. These functions has a very low chance of colision
I agree with Clever, to do what you're asking, the best option is HashXXX(). Unless you're dealing with rows in the billions, I'd recommend Hash128. The only drawback that you'll find is that each unique instance requires 16 bytes (for Hash128, 160 is 20 bytes and 256 is 32 bytes per unique instance). This shouldn't be an issue if you are storing tables into QVD, but I would suggest wrapping an AutoNumber(hash_field, 'key_name') around your hashed fields when loading into an application meant for user consumption. It may slow down your reloads a little bit, but it will consume a lot less memory on load and should perform better.